Salome HOME
Enable ctest, make test and salome test
[plugins/hybridplugin.git] / tests / CMakeLists.txt
index 32376152f127fb76317dbc45a0915d6bfc4527a1..fd9f05f4a87a61337b5cda07fad01355d31e30d5 100755 (executable)
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+INCLUDE(tests.set)
 
-SET(HYBRIDPLUGIN_TEST_FILES
-  test_cartesian_core_size.py
-  test_enforced_mesh.py
-  test_layers_imprinting.py
-  test_layers_imprinting_hexa_core.py
-  test_mg_hybrid_pyramids.py
-)
+SET(COMPONENT_NAME HYBRIDPLUGIN)
 
-INSTALL(FILES ${HYBRIDPLUGIN_TEST_FILES} DESTINATION ${SALOME_HYBRIDPLUGIN_INSTALL_TESTS})
+SET(TEST_INSTALL_DIRECTORY ${SALOME_HYBRIDPLUGIN_INSTALL_TESTS})
+
+# make test
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
+FOREACH(tfile ${TEST_NAMES})
+  SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
+  ADD_TEST(NAME ${TEST_NAME}
+           COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py)
+  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}")
+  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDFOREACH()
+
+# salome test
+FOREACH(tfile ${TEST_NAMES})
+  INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py
+          DESTINATION ${TEST_INSTALL_DIRECTORY})
+ENDFOREACH()
+
+INSTALL(FILES CTestTestfileInstall.cmake
+  DESTINATION ${TEST_INSTALL_DIRECTORY}
+  RENAME CTestTestfile.cmake)
+
+INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
\ No newline at end of file