@@ -7,4 +7,35 @@ if (NOT SCREAM_ONLY_GENERATE_BASELINES)
77 ${CMAKE_CURRENT_BINARY_DIR} /my_module.py)
88 CreateUnitTest(pysession "pysession.cpp" )
99 endif ()
10+
11+ # Tests to ensure that fails/errors are indeed caught
12+ # NOTE: we don't need any libs for this test, but scream's CreateUnitTest
13+ # has libs as a required arg. So use the raw EkatCreateUnitTest
14+
15+ # This serves as a base case for the following fail checks, since it verifies that
16+ # - a REQUIRE clause that fails makes the test fail
17+ # - Our Create unit test logic does work for catching failures
18+ CreateUnitTest (fail "fail.cpp"
19+ WILL_FAIL LABELS "fail" )
20+
21+ if (Kokkos_ENABLE_DEBUG_BOUNDS_CHECK)
22+ # Ensure that Kokkos OOB are caught
23+ CreateUnitTest (kokkos_fail "kokkos_fail.cpp"
24+ WILL_FAIL LABELS "fail" )
25+ endif ()
26+
27+ if (EKAT_ENABLE_VALGRIND)
28+ # Ensure that valgrind errors are caught
29+ EkatCreateUnitTest (valg_fail "valg_fail.cpp"
30+ WILL_FAIL LABELS "fail" )
31+ endif ()
32+
33+ # Ensure that FPE *do* throw when we expect them to
34+ if (SCREAM_FPE)
35+ CreateUnitTestExec (fpe_check "fpe_check.cpp"
36+ WILL_FAIL LABELS "check" )
37+ else ()
38+ CreateUnitTestExec (fpe_check "fpe_check.cpp"
39+ LABELS "check" )
40+ endif ()
1041endif ()
0 commit comments