1 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 # NewGeom unit test system
8 # ADD_UNIT_TESTS(TestUndoRedo.py
11 # SET(PROJECT_UNIT_TESTS
15 # ADD_UNIT_TESTS(${PROJECT_UNIT_TESTS})
17 # Where "TestUndoRedo.py" and "TestResultBody.py" are names
18 # of python test scripts in the "./Test" directory.
19 # This macro will add "Subproject_" as prefix and
20 # remove ".py" for the test name automaticaly.
22 # Start building of the "RUN_TESTS" project in the Visual studio
23 # or run "make test" on linux stations to start the testing procedure.
29 foreach(eachFileName ${ARGN})
30 # Strip the ".py" suffix
31 GET_FILENAME_COMPONENT(aTestName ${eachFileName} NAME_WE)
33 # Add "SubprojectName_" prefix
34 GET_FILENAME_COMPONENT(aSubprojectName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
35 SET(aTestName "${aSubprojectName}_${aTestName}")
37 # Full path to the python test file beeing executed
38 SET(aTestFileName "${CMAKE_CURRENT_SOURCE_DIR}/Test/${eachFileName}")
39 IF(EXISTS ${aTestFileName})
40 ADD_TEST(NAME ${aTestName}
41 COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
43 #MESSAGE(STATUS "Test added: ${aTestName} file: ${aTestFileName}")
44 ELSE(EXISTS ${aTestFileName})
45 MESSAGE(WARNING "Can not find the test file: ${aTestFileName}")
46 ENDIF(EXISTS ${aTestFileName})
47 endforeach(eachFileName ${ARGN})
48 ENDMACRO(ADD_UNIT_TESTS)