diff --git a/examples/ida/serial/CMakeLists.txt b/examples/ida/serial/CMakeLists.txt index 665821fdd8..132ad66238 100644 --- a/examples/ida/serial/CMakeLists.txt +++ b/examples/ida/serial/CMakeLists.txt @@ -132,12 +132,9 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLLAPACK_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -184,12 +181,9 @@ if(BUILD_SUNLINSOL_KLU) target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLKLU_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -236,12 +230,9 @@ if(BUILD_SUNLINSOL_SUPERLUMT) target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLSLUMT_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # Do not include SuperLUMT examples in testing when the indextype is int64_t. # Answer files were generated with int32_t and minor differences in output diff --git a/examples/sunlinsol/band/CMakeLists.txt b/examples/sunlinsol/band/CMakeLists.txt index 307f54969a..3805ecf8aa 100644 --- a/examples/sunlinsol/band/CMakeLists.txt +++ b/examples/sunlinsol/band/CMakeLists.txt @@ -84,11 +84,8 @@ foreach(example_tuple ${sunlinsol_band_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -127,11 +124,8 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunlinsol/dense/CMakeLists.txt b/examples/sunlinsol/dense/CMakeLists.txt index f5e16cdac5..47e44a3470 100644 --- a/examples/sunlinsol/dense/CMakeLists.txt +++ b/examples/sunlinsol/dense/CMakeLists.txt @@ -85,11 +85,8 @@ foreach(example_tuple ${sunlinsol_dense_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -127,12 +124,9 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) target_link_libraries(${example} ${SUNDIALS_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunlinsol/pcg/serial/CMakeLists.txt b/examples/sunlinsol/pcg/serial/CMakeLists.txt index a814cfb008..4602830965 100644 --- a/examples/sunlinsol/pcg/serial/CMakeLists.txt +++ b/examples/sunlinsol/pcg/serial/CMakeLists.txt @@ -90,11 +90,8 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -132,12 +129,9 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) target_link_libraries(${example} ${SUNDIALS_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt index ae48c2cdf7..81f676f90c 100644 --- a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt +++ b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt @@ -91,11 +91,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -132,12 +129,9 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) target_link_libraries(${example} ${SUNDIALS_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt index f860c81af8..cb3e8d324d 100644 --- a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt @@ -90,11 +90,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -132,12 +129,9 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) target_link_libraries(${example} ${SUNDIALS_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunlinsol/spgmr/serial/CMakeLists.txt b/examples/sunlinsol/spgmr/serial/CMakeLists.txt index 3b3eef4460..209ad061dd 100644 --- a/examples/sunlinsol/spgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spgmr/serial/CMakeLists.txt @@ -94,11 +94,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -136,12 +133,9 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) target_link_libraries(${example} ${SUNDIALS_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt index 8f765c1440..c485890ec0 100644 --- a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt @@ -93,11 +93,9 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) + # add example to regression tests sundials_add_test(${test_name} ${example} @@ -135,12 +133,9 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) target_link_libraries(${example} ${SUNDIALS_LIBS}) endif() - # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + # check if example args are provided and set the test name + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunmatrix/band/CMakeLists.txt b/examples/sunmatrix/band/CMakeLists.txt index 834067efa3..a162da72ff 100644 --- a/examples/sunmatrix/band/CMakeLists.txt +++ b/examples/sunmatrix/band/CMakeLists.txt @@ -85,11 +85,8 @@ foreach(example_tuple ${sunmatrix_band_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -128,11 +125,8 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunmatrix/dense/CMakeLists.txt b/examples/sunmatrix/dense/CMakeLists.txt index 07cd2172cd..9266b9ecb7 100644 --- a/examples/sunmatrix/dense/CMakeLists.txt +++ b/examples/sunmatrix/dense/CMakeLists.txt @@ -84,11 +84,8 @@ foreach(example_tuple ${sunmatrix_dense_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -124,11 +121,8 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunmatrix/sparse/CMakeLists.txt b/examples/sunmatrix/sparse/CMakeLists.txt index 79334176d4..bb22aaa690 100644 --- a/examples/sunmatrix/sparse/CMakeLists.txt +++ b/examples/sunmatrix/sparse/CMakeLists.txt @@ -20,12 +20,12 @@ # Examples using SUNDIALS sparse matrix set(sunmatrix_sparse_examples - "test_sunmatrix_sparse.c\; \"400 400 0 0\" \;passfail" - "test_sunmatrix_sparse.c\; \"450 450 1 0\" \;passfail" - "test_sunmatrix_sparse.c\; \"200 1000 0 0\" \;passfail" - "test_sunmatrix_sparse.c\; \"6000 350 0 0\" \;passfail" - "test_sunmatrix_sparse.c\; \"500 5000 1 0\" \;passfail" - "test_sunmatrix_sparse.c\; \"4000 800 1 0\" \;passfail" + "test_sunmatrix_sparse.c\;400 400 0 0\;passfail" + "test_sunmatrix_sparse.c\;450 450 1 0\;passfail" + "test_sunmatrix_sparse.c\;200 1000 0 0\;passfail" + "test_sunmatrix_sparse.c\;6000 350 0 0\;passfail" + "test_sunmatrix_sparse.c\;500 5000 1 0\;passfail" + "test_sunmatrix_sparse.c\;4000 800 1 0\;passfail" ) # Dependencies for sunmatrix examples @@ -87,11 +87,8 @@ foreach(example_tuple ${sunmatrix_sparse_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -127,11 +124,8 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt index 73186257cd..898724b1c5 100644 --- a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -69,11 +69,8 @@ foreach(example_tuple ${sunnonlinsol_fixedpoint_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -108,11 +105,8 @@ foreach(example_tuple ${sunnonlinsol_fixedpoint_fortran_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} diff --git a/examples/sunnonlinsol/newton/CMakeLists.txt b/examples/sunnonlinsol/newton/CMakeLists.txt index 6353084cc7..df3d5bfd1f 100644 --- a/examples/sunnonlinsol/newton/CMakeLists.txt +++ b/examples/sunnonlinsol/newton/CMakeLists.txt @@ -70,11 +70,8 @@ foreach(example_tuple ${sunnonlinsol_newton_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example} @@ -109,11 +106,8 @@ foreach(example_tuple ${sunnonlinsol_newton_fortran_examples}) endif() # check if example args are provided and set the test name - if("${example_args}" STREQUAL "") - set(test_name ${example}) - else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - endif() + sundials_create_test_name(${example} test_name + TEST_ARGS ${example_args}) # add example to regression tests sundials_add_test(${test_name} ${example}