Skip to content

Commit

Permalink
utilize new SundialsCreateTestName macro
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbajsohal committed Aug 1, 2023
1 parent 187536f commit 57f2b72
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 150 deletions.
27 changes: 9 additions & 18 deletions examples/ida/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
14 changes: 4 additions & 10 deletions examples/sunlinsol/band/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
16 changes: 5 additions & 11 deletions examples/sunlinsol/dense/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
16 changes: 5 additions & 11 deletions examples/sunlinsol/pcg/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
16 changes: 5 additions & 11 deletions examples/sunlinsol/spbcgs/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
16 changes: 5 additions & 11 deletions examples/sunlinsol/spfgmr/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
16 changes: 5 additions & 11 deletions examples/sunlinsol/spgmr/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
17 changes: 6 additions & 11 deletions examples/sunlinsol/sptfqmr/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
14 changes: 4 additions & 10 deletions examples/sunmatrix/band/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
14 changes: 4 additions & 10 deletions examples/sunmatrix/dense/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
26 changes: 10 additions & 16 deletions examples/sunmatrix/sparse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
14 changes: 4 additions & 10 deletions examples/sunnonlinsol/fixedpoint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
Loading

0 comments on commit 57f2b72

Please sign in to comment.