Permalink
Browse files

Add a CTest test for each python unittest.

The list of available unittests is hardcoded in the cmake/UnitTests.cmake
file and can be regenerated by building the "list_unittests" target.
  • Loading branch information...
1 parent 4ee6f7b commit 0537465842fc4a59e241e6a3aee69cc75a4cdb97 @jcfr jcfr committed Apr 12, 2013
Showing with 429 additions and 0 deletions.
  1. +13 −0 CMakeLists.txt
  2. +416 −0 cmake/UnitTests.cmake
View
@@ -244,6 +244,19 @@ if(UNIX)
endif(UNIX)
+if(BUILD_TESTING)
+ set(EXTRATESTOPTS -v)
+ set(TESTOPTS -l ${EXTRATESTOPTS})
+ set(TESTPROG ${CMAKE_BINARY_DIR}/${PYTHONHOME}/test/regrtest.py)
+ set(TESTPYTHONOPTS )
+ set(TESTPYTHON $<TARGET_FILE:python> -Wd -3 -E -tt ${TESTPYTHONOPTS})
+
+ include(cmake/UnitTests.cmake)
+ foreach(unittest ${unittests})
+ add_test(NAME ${unittest} COMMAND ${TESTPYTHON} ${TESTPROG} ${TESTOPTS} ${unittest})
+ endforeach(unittest)
+endif(BUILD_TESTING)
+
if(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE)
Oops, something went wrong.

0 comments on commit 0537465

Please sign in to comment.