From 2810f421ae10869f50ee9b95c3260e3d38734306 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Wed, 12 Nov 2014 07:43:17 -0800
Subject: Added cmake test target.

---
 CMakeLists.txt |  7 +++++++
 README.md      | 16 ++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f1dc25..3dc16a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,13 @@ if(UNIX)
   INSTALL(FILES man/man1/cmark.1 DESTINATION share/man/man1)
 endif(UNIX)
 
+enable_testing()
+
+# To get verbose output: cmake --build build --target "test" -- ARGS='-V'
+add_test(spectest
+   COMMAND perl "${CMAKE_SOURCE_DIR}/runtests.pl" "${CMAKE_SOURCE_DIR}/spec.txt" "${CMAKE_BINARY_DIR}/src/cmark"
+)
+
 if(NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE "Release" CACHE STRING
   "Choose the type of build, options are: Debug Release." FORCE)
diff --git a/README.md b/README.md
index c83611e..ff75eb7 100644
--- a/README.md
+++ b/README.md
@@ -52,8 +52,8 @@ untrusted user input, you must run the output through an HTML
 sanitizer to protect against
 [XSS attacks](http://en.wikipedia.org/wiki/Cross-site_scripting).
 
-Installing
-----------
+Installing (C)
+--------------
 
 Building the C program (`cmark`) and shared library (`libcmark`)
 requires [cmake] and [re2c], which is used to generate `scanners.c` from
@@ -79,10 +79,17 @@ To run tests:
 
     make test
 
-or
+or:
 
     perl runtests.pl spec.txt build/src/cmark
 
+or (in the cmake build directory):
+
+    ctest -V
+
+Installing (JavaScript)
+-----------------------
+
 The JavaScript library can be installed through `npm`:
 
     npm install commonmark
@@ -102,9 +109,6 @@ or
 
     node js/test.js
 
-`make dingus` will start an interactive dingus you can use to
-play with the JavaScript implementation:
-
 The spec
 --------
 
-- 
cgit v1.2.3