Skip to content

Commit

Permalink
add test for non-existend wb filea as input.
Browse files Browse the repository at this point in the history
  • Loading branch information
MFraters committed Feb 24, 2024
1 parent 22a70a4 commit 63cc40c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/gwb-grid/grid_non_existing_wb.log
Original file line number Diff line number Diff line change
@@ -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 </home/m/programming/world-builder/WorldBuilder/tests/data/subducting_plate_composition_smooth_non-existing.wb>.

Expand Down

0 comments on commit 63cc40c

Please sign in to comment.