Skip to content

Commit

Permalink
Merge pull request #355 from Chaste/353-configure-codegen-tests
Browse files Browse the repository at this point in the history
Fix duplicate Codegen tests
  • Loading branch information
mirams authored Jan 13, 2025
2 parents 022a815 + 45d896f commit a3c31c7
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions cmake/Modules/ChasteMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,6 @@ macro(Chaste_ADD_TEST _testTargetName _filename)
set(_testname ${_testTargetName})
endif()

string(REGEX MATCH "^.*Codegen$" foundCodegen ${_testTargetName})
if (foundCodegen)
set(codegen ON)
string(REGEX REPLACE "(Codegen)$" "" _testname "${_testTargetName}")
else()
set(codegen OFF)
set(_testname ${_testTargetName})
endif()

if (${_filename} MATCHES ".py$")
set(python ON)
else()
Expand Down Expand Up @@ -579,14 +570,14 @@ macro(Chaste_DO_TEST_COMMON component)
set(testTargetName ${testTargetName}Parallel)
set(parallel ON)
endif()
set(codegen OFF)
set(exeTargetName ${testTargetName})
if (${type} STREQUAL "Codegen")
set(testTargetName ${testTargetName}Codegen)
set(codegen ON)
endif()

if (NOT DEFINED ${testTargetName})
if (DEFINED ${testTargetName})
# if the test has already been defined, add it to this test pack
get_property(test_labels TEST ${testTargetName} PROPERTY LABELS)
list(APPEND test_labels ${type}_${component})
set_property(TEST ${testTargetName} PROPERTY LABELS "${test_labels}")

else()
set(${testTargetName} ON)
chaste_add_test(${testTargetName} "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")

Expand Down

0 comments on commit a3c31c7

Please sign in to comment.