diff --git a/CMake/sdpmMacros.cmake b/CMake/sdpmMacros.cmake
index 60bfa4966765014002c84755b6cf716884e2f362..c309dcc00a21c2eae79523a9c1f964139a6bab05 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()