From 6bec7bbacb89c7c496c0beead805a30fcdca8b0f Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 21 Jul 2010 08:34:54 +0000 Subject: [PATCH] add make test for UNIT_TEST_PROG --- salome_adm/cmake_files/am2cmake.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index b2c757193..809219c09 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -438,6 +438,10 @@ class CMakeFile(object): ENDIF(COMMAND cmake_policy) """) # -- + newlines.append(""" + ENABLE_TESTING() + """) + # -- if self.module == "kernel": newlines.append(""" INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake) @@ -1255,6 +1259,24 @@ class CMakeFile(object): ENDFOREACH(input ${SIP_FILES}) ''') pass + + # -- + # For make check + # -- + key = "UNIT_TEST_PROG" + if self.__thedict__.has_key(key): + newlines.append(''' + FOREACH(input ${UNIT_TEST_PROG}) + SET(fail_regex "KO") + IF(WINDOWS) + ADD_TEST(${input} ${CMAKE_CURRENT_BINARY_DIR}/${input}_exe.exe) + ELSE() + ADD_TEST(${input} ${CMAKE_CURRENT_BINARY_DIR}/${input}_exe) + ENDIF() + SET_PROPERTY(TEST ${input} PROPERTY FAIL_REGULAR_EXPRESSION "${fail_regex}") + ENDFOREACH(input ${UNIT_TEST_PROG}) + ''') + pass # -- # Treat the install targets -- 2.39.2