Salome HOME
Test1967: Update tolerance ratio for moving vs creating.
[modules/shaper.git] / CMakeCommon / UnitTest.cmake
index b3abbba732b56a70bee04dd9f3c3236e44181fe6..a1eca3d7312276cdabf7349fcff83f04a6503e5a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+# Copyright (C) 2014-2023  CEA, EDF
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -55,6 +55,9 @@ function(GENERATE_TESTS PATH testdir TESTS)
 
     # Full path to the python test file beeing executed
     SET(aTestFileName "${testdir}/${eachFileName}")
+    IF(NOT EXISTS ${aTestFileName})
+      SET(aTestFileName "${testdir}/Test/${eachFileName}")
+    ENDIF(NOT EXISTS ${aTestFileName})
     IF(EXISTS ${aTestFileName})
       ADD_TEST(NAME ${aTestName}
                COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
@@ -64,13 +67,15 @@ function(GENERATE_TESTS PATH testdir TESTS)
       # Debug output...
       #MESSAGE(STATUS "Test added: ${aTestName} file: ${aTestFileName}")
     ELSE(EXISTS ${aTestFileName})
-      MESSAGE(WARNING "Can not find the test file: ${aTestFileName}")
+      MESSAGE(WARNING "Can not find the test file: ${eachFileName}")
+      MESSAGE(STATUS "Search paths are: ${testdir}")
+      MESSAGE(STATUS "                  ${testdir}/Test")
     ENDIF(EXISTS ${aTestFileName})
   endforeach(eachFileName ${ARGN})
 endfunction(GENERATE_TESTS)
 
 function(ADD_UNIT_TESTS)
-  GENERATE_TESTS(PATH "${CMAKE_CURRENT_SOURCE_DIR}/Test" TESTS ${ARGN})
+  GENERATE_TESTS(PATH "${CMAKE_CURRENT_SOURCE_DIR}" TESTS ${ARGN})
 endfunction(ADD_UNIT_TESTS)
 
 function(ADD_UNIT_TESTS_API)