if self.__thedict__.has_key(key):
newlines.append('''
FOREACH(input ${UNIT_TEST_PROG})
- SET(fail_regex "KO")
GET_FILENAME_COMPONENT(ext ${input} EXT)
IF(ext STREQUAL .py)
- ADD_TEST(${input} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+ SET(test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${input})
ELSE(ext STREQUAL .py)
IF(WINDOWS)
- ADD_TEST(${input} ${CMAKE_CURRENT_BINARY_DIR}/${input}_exe.exe)
+ SET(test ${CMAKE_CURRENT_BINARY_DIR}/${input}_exe.exe)
ELSE()
- ADD_TEST(${input} ${CMAKE_CURRENT_BINARY_DIR}/${input}_exe)
+ SET(test ${CMAKE_CURRENT_BINARY_DIR}/${input}_exe)
ENDIF()
ENDIF(ext STREQUAL .py)
+ ADD_TEST(${input} ${test})
+ SET(fail_regex "KO")
SET_PROPERTY(TEST ${input} PROPERTY FAIL_REGULAR_EXPRESSION "${fail_regex}")
+ # IF(NOT WINDOWS)
+ # ADD_TEST(${input}_valgrind valgrind ${test})
+ # SET_PROPERTY(TEST ${input}_valgrind PROPERTY FAIL_REGULAR_EXPRESSION "${fail_regex}")
+ # SET_PROPERTY(TEST ${input}_valgrind PROPERTY PASS_REGULAR_EXPRESSION "no leaks are possible")
+ # ENDIF()
ENDFOREACH(input ${UNIT_TEST_PROG})
''')
pass