From 42ac8f52f50a81d73194a0e4a437d3d8b66d2b7c Mon Sep 17 00:00:00 2001 From: MFraters Date: Sat, 24 Feb 2024 13:47:17 -0500 Subject: [PATCH] Add test for gwb-grid having too many arguments. --- tests/CMakeLists.txt | 14 ++++++++++++++ tests/gwb-grid/grid_too_many_arguments.log | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 tests/gwb-grid/grid_too_many_arguments.log diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4a18c70c7..9dc0199e8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -172,6 +172,20 @@ IF(WB_RUN_APP_TESTS) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/) + # Add tests which test what happens when too many arguments are provided. + 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\;too;many;arguments") + add_test(grid_too_many_arguments + ${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_too_many_arguments.log + -D TEST_REFERENCE=${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/grid_too_many_arguments.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_too_many_arguments.log b/tests/gwb-grid/grid_too_many_arguments.log new file mode 100644 index 000000000..ee542ccda --- /dev/null +++ b/tests/gwb-grid/grid_too_many_arguments.log @@ -0,0 +1,3 @@ +World Builder Grid Visualization tool. +Usage: /home/m/programming/world-builder/WorldBuilder/build-v3/bin/gwb-grid example.wb example.grid +Try '/home/m/programming/world-builder/WorldBuilder/build-v3/bin/gwb-grid --help' for more information.