From f16c14165aa5d31b09c10db2226dff790ede64ce Mon Sep 17 00:00:00 2001 From: acrovato <a.crovato@uliege.be> Date: Mon, 30 Sep 2024 16:00:32 +0200 Subject: [PATCH] Deactivate AD tests when CoDi is not enabled --- CMake/sdpmMacros.cmake | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/CMake/sdpmMacros.cmake b/CMake/sdpmMacros.cmake index 60bfa49..c309dcc 100644 --- a/CMake/sdpmMacros.cmake +++ b/CMake/sdpmMacros.cmake @@ -1,11 +1,11 @@ # Copyright 2023 University of Liège -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,14 +18,17 @@ MACRO(MACRO_AddTest srcDir) file(GLOB tfiles RELATIVE ${srcDir} ${srcDir}/*) foreach(tfile ${tfiles}) set(spath ${srcDir}/${tfile}) - if(NOT IS_DIRECTORY ${spath} AND - ${spath} MATCHES ".+\\.py$" AND - NOT ${tfile} STREQUAL "__init__.py") - string(REPLACE "${PROJECT_SOURCE_DIR}/" "" strip ${spath}) - message(STATUS "Adding test ${strip}") - add_test(NAME ${strip} - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMAND ${Python3_EXECUTABLE} "${PROJECT_SOURCE_DIR}/run.py" --nogui --clean ${strip}) + if(NOT IS_DIRECTORY ${spath} AND ${spath} MATCHES ".+\\.py$" AND NOT ${tfile} STREQUAL "__init__.py") + if(${USE_CODI} MATCHES "OFF" AND ${tfile} MATCHES "._ad+\\.py$") + string(REPLACE "${PROJECT_SOURCE_DIR}/" "" strip ${spath}) + message(STATUS "Skipping test ${strip}") + else() + string(REPLACE "${PROJECT_SOURCE_DIR}/" "" strip ${spath}) + message(STATUS "Adding test ${strip}") + add_test(NAME ${strip} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMAND ${Python3_EXECUTABLE} "${PROJECT_SOURCE_DIR}/run.py" --nogui --clean ${strip}) + endif() else() MACRO_AddTest(${srcDir}/${tfile}) endif() -- GitLab