From 4742446dbd48ac6b7f20929b62113abbf4617fcb Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 4 Oct 2021 13:37:28 +0300 Subject: [PATCH] Eliminate a lot of CMake warnings about not found tests with the hint of search path. --- CMakeCommon/UnitTest.cmake | 9 +++++++-- src/ExchangePlugin/Test/CMakeLists.txt | 2 +- test.API/SHAPER/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) 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() -- 2.39.2