From 63cc40c491092391c98127ffafaa305501f1e598 Mon Sep 17 00:00:00 2001 From: MFraters Date: Sat, 24 Feb 2024 15:56:49 -0500 Subject: [PATCH] add test for non-existend wb filea as input. --- tests/CMakeLists.txt | 14 ++++++++++++++ tests/gwb-grid/grid_non_existing_wb.log | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 tests/gwb-grid/grid_non_existing_wb.log diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0a53ff87c..814321f40 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -200,6 +200,20 @@ IF(WB_RUN_APP_TESTS) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/) + + # Add tests which input a non-existing input file + set(TEST_ARGUMENTS "${CMAKE_SOURCE_DIR}/tests/data/subducting_plate_composition_smooth_non-existing.wb\;${CMAKE_SOURCE_DIR}/tests/gwb-grid/subducting_plate_composition_smooth.grid") + add_test(grid_non_existing_wb + ${CMAKE_COMMAND} + -D TEST_NAME=${test_name} + -D TEST_PROGRAM=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gwb-grid${CMAKE_EXECUTABLE_SUFFIX} + -D TEST_ARGS=${TEST_ARGUMENTS} + -D TEST_DIFF=${TEST_DIFF} + -D TEST_OUTPUT=${CMAKE_BINARY_DIR}/tests/gwb-grid/grid_non_existing_wb.log + -D TEST_REFERENCE=${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/grid_non_existing_wb.log + -P ${CMAKE_SOURCE_DIR}/tests/gwb-dat/run_gwb-dat_tests.cmake + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/) + # Add tests which filters the output. set(TEST_ARGUMENTS "${CMAKE_SOURCE_DIR}/tests/data/subducting_plate_composition_smooth_filtered.wb\;${CMAKE_SOURCE_DIR}/tests/gwb-grid/subducting_plate_composition_smooth.grid\;--filtered") add_test(grid_filtered diff --git a/tests/gwb-grid/grid_non_existing_wb.log b/tests/gwb-grid/grid_non_existing_wb.log new file mode 100644 index 000000000..3038c3233 --- /dev/null +++ b/tests/gwb-grid/grid_non_existing_wb.log @@ -0,0 +1,3 @@ +[1/6] Parsing file... [2/6] Starting the world builder with -- threads... Expected fail with: +AssertThrow `ierr` failed in (..path..)/source/world_builder/utilities.cc at line (..line..): Could not open file . +