]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
add make test for UNIT_TEST_PROG
authoradam <adam>
Wed, 21 Jul 2010 08:34:54 +0000 (08:34 +0000)
committeradam <adam>
Wed, 21 Jul 2010 08:34:54 +0000 (08:34 +0000)
salome_adm/cmake_files/am2cmake.py

index b2c757193580993bc91629d56b3e58a153d7b772..809219c098974c7e8e07daf4dc3499da00e9f94e 100644 (file)
@@ -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