]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Eliminate a lot of CMake warnings about not found tests with the hint of search path.
authorazv <azv@opencascade.com>
Mon, 4 Oct 2021 10:37:28 +0000 (13:37 +0300)
committerazv <azv@opencascade.com>
Mon, 4 Oct 2021 10:39:08 +0000 (13:39 +0300)
CMakeCommon/UnitTest.cmake
src/ExchangePlugin/Test/CMakeLists.txt
test.API/SHAPER/CMakeLists.txt

index a3912e337d8aaf54d6c362e3262609912455f280..147f2529669160e85dd8080d4459ce51d193d184 100644 (file)
@@ -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)
index 2abd05c3f4cda81fe614842f8c386922a5892e23..6d267d4310cf7cd43d7c08976e10bf2a4517a50d 100755 (executable)
@@ -19,7 +19,7 @@
 
 include(tests.set)
 
-ADD_UNIT_TESTS_API(${TEST_NAMES})
+ADD_UNIT_TESTS(${TEST_NAMES})
 
 if(${HAVE_SALOME})
   enable_testing()
index 7c335ba6531929adf73129281666cdced6aaeb74..814ab2ee842b52aa36ed5227a54f71708f897ec1 100644 (file)
@@ -21,7 +21,7 @@ INCLUDE(UnitTest)
 
 include(tests.set)
 
-ADD_UNIT_TESTS_API(${TEST_NAMES})
+ADD_UNIT_TESTS(${TEST_NAMES})
 
 if(${HAVE_SALOME})
   enable_testing()