summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-02-09 11:31:23 -0700
committerCraig Earls <enderw88@gmail.com>2014-02-09 11:31:23 -0700
commit050edd56ce59083ddc7f5770dc0c934052fd1be1 (patch)
tree42f5f0db1062e1371bce3162bfee2d615b766b36 /test/CMakeLists.txt
parentffc8bf30f458408c2735854de92d51081d6e6a49 (diff)
parenta2f86c85df7ac9f00facefbc9318e2a06e41b73b (diff)
downloadfork-ledger-050edd56ce59083ddc7f5770dc0c934052fd1be1.tar.gz
fork-ledger-050edd56ce59083ddc7f5770dc0c934052fd1be1.tar.bz2
fork-ledger-050edd56ce59083ddc7f5770dc0c934052fd1be1.zip
Merge pull request #240 from afh/pull/DocTests
Validate examples in the texinfo documentation when running tests.
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 94ce0a0a..796ef0a2 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -38,4 +38,16 @@ add_subdirectory(manual)
add_subdirectory(baseline)
add_subdirectory(regress)
+if(PYTHONINTERP_FOUND)
+ set(_class DocTests)
+ file(GLOB ${_class}_TESTS ${PROJECT_SOURCE_DIR}/doc/*.texi)
+ foreach(TestFile ${${_class}_TESTS})
+ get_filename_component(TestFile_Name ${TestFile} NAME_WE)
+ add_test(${_class}Test_${TestFile_Name}
+ ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/DocTests.py
+ --ledger ${LEDGER_LOCATION} --file ${TestFile})
+ set_target_properties(check PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
+ endforeach()
+endif()
+
### CMakeLists.txt ends here