Skip to content

Commit

Permalink
Escape fewer characters to reduce probability of collision
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Sep 27, 2024
1 parent 61e985c commit 8918353
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmake/CeleritasAddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ set(CELERITASTEST_NP_DEFAULT "${_procs}" CACHE INTERNAL
set(_procs)

if(NOT CELERITAS_USE_MPI)
# Construct test name with MPI enabled, or empty if not applicable
# Skip tests that require greater than 1 process
function(_celeritasaddtest_test_name outvar test_name np suffix)
set(_name "${test_name}${suffix}")
if(np GREATER 1)
Expand All @@ -168,13 +168,13 @@ if(NOT CELERITAS_USE_MPI)
set(${outvar} "${_name}" PARENT_SCOPE)
endfunction()

# Construct MPI command, or empty if not applicable
# Construct execution command
function(_celeritasaddtest_mpi_cmd outvar np test_exe)
set(_cmd "${test_exe}" ${ARGN})
set(${outvar} "${_cmd}" PARENT_SCOPE)
endfunction()
else()
# Construct test name with MPI enabled but not tribits
# Construct test name with number of processors
function(_celeritasaddtest_test_name outvar test_name np suffix)
if(np GREATER CELERITAS_MAX_NUMPROCS)
set(_name)
Expand All @@ -186,6 +186,7 @@ else()
set(${outvar} "${_name}" PARENT_SCOPE)
endfunction()

# Construct MPI command
function(_celeritasaddtest_mpi_cmd outvar np test_exe)
if(np GREATER 1)
set(_cmd "${MPIEXEC_EXECUTABLE}" ${MPIEXEC_NUMPROC_FLAG} "${np}"
Expand Down Expand Up @@ -412,7 +413,7 @@ function(celeritas_add_test SOURCE_FILE)
list(APPEND _test_args "--gtest_filter=${_filter}")
endif()
if(CELERITAS_TEST_XML)
string(REGEX REPLACE "[^a-zA-Z0-9_]+" "_" _xml_name "${_TEST_NAME}")
string(REGEX REPLACE "[^a-zA-Z0-9_.+*-]+" "_" _xml_name "${_TEST_NAME}")
list(APPEND _test_args
"--gtest_output=xml:${CELERITAS_TEST_XML}/${_xml_name}.xml"
)
Expand Down

0 comments on commit 8918353

Please sign in to comment.