summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2014-02-07 00:21:38 +0100
committerAlexis Hildebrandt <afh@surryhill.net>2014-02-07 00:21:38 +0100
commitfbbb379fe08b051b40c071041108a2526533f417 (patch)
treeb6cb11c1c40f80bb89d90668ee739593381bb576 /test/CMakeLists.txt
parentffc8bf30f458408c2735854de92d51081d6e6a49 (diff)
downloadfork-ledger-fbbb379fe08b051b40c071041108a2526533f417.tar.gz
fork-ledger-fbbb379fe08b051b40c071041108a2526533f417.tar.bz2
fork-ledger-fbbb379fe08b051b40c071041108a2526533f417.zip
Check examples in documentation when running tests
The DocTests.py script will parse a given texinfo file for specially marked examples, run the ledger command from the example, and check the result against the example output from the documentation.
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..159ab5be 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_LOCATION} ${TestFile})
+ set_target_properties(check PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
+ endforeach()
+endif()
+
### CMakeLists.txt ends here