Salome HOME
Copyright update 2022
[plugins/hybridplugin.git] / tests / CMakeLists.txt
old mode 100755 (executable)
new mode 100644 (file)
index 3237615..af82dcd
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2013-2022  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 #
 # 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