From: azv Date: Mon, 4 Oct 2021 10:37:28 +0000 (+0300) Subject: Eliminate a lot of CMake warnings about not found tests with the hint of search path. X-Git-Tag: V9_8_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4742446dbd48ac6b7f20929b62113abbf4617fcb;p=modules%2Fshaper.git Eliminate a lot of CMake warnings about not found tests with the hint of search path. --- diff --git a/CMakeCommon/UnitTest.cmake b/CMakeCommon/UnitTest.cmake index a3912e337..147f25296 100644 --- a/CMakeCommon/UnitTest.cmake +++ b/CMakeCommon/UnitTest.cmake @@ -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) diff --git a/src/ExchangePlugin/Test/CMakeLists.txt b/src/ExchangePlugin/Test/CMakeLists.txt index 2abd05c3f..6d267d431 100755 --- a/src/ExchangePlugin/Test/CMakeLists.txt +++ b/src/ExchangePlugin/Test/CMakeLists.txt @@ -19,7 +19,7 @@ include(tests.set) -ADD_UNIT_TESTS_API(${TEST_NAMES}) +ADD_UNIT_TESTS(${TEST_NAMES}) if(${HAVE_SALOME}) enable_testing() diff --git a/test.API/SHAPER/CMakeLists.txt b/test.API/SHAPER/CMakeLists.txt index 7c335ba65..814ab2ee8 100644 --- a/test.API/SHAPER/CMakeLists.txt +++ b/test.API/SHAPER/CMakeLists.txt @@ -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()