Skip to content

Commit

Permalink
Test: Add a SCRIPT logic and test raytracing without raytracing
Browse files Browse the repository at this point in the history
  • Loading branch information
mwestphal committed Dec 3, 2024
1 parent e6119e9 commit 65b224c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 21 deletions.
15 changes: 9 additions & 6 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# F3D Testing
function(f3d_test)

cmake_parse_arguments(F3D_TEST "TONE_MAPPING;LONG_TIMEOUT;INTERACTION;INTERACTION_CONFIGURE;NO_BASELINE;NO_RENDER;NO_OUTPUT;WILL_FAIL;NO_DATA_FORCE_RENDER;UI" "NAME;CONFIG;RESOLUTION;THRESHOLD;REGEXP;REGEXP_FAIL;HDRI;RENDERING_BACKEND" "DATA;DEPENDS;ENV;ARGS" ${ARGN})
cmake_parse_arguments(F3D_TEST "TONE_MAPPING;LONG_TIMEOUT;INTERACTION;INTERACTION_CONFIGURE;NO_BASELINE;NO_RENDER;NO_OUTPUT;WILL_FAIL;NO_DATA_FORCE_RENDER;UI" "NAME;CONFIG;RESOLUTION;THRESHOLD;REGEXP;REGEXP_FAIL;HDRI;SCRIPT;RENDERING_BACKEND" "DATA;DEPENDS;ENV;ARGS" ${ARGN})

if(F3D_TEST_CONFIG)
list(APPEND F3D_TEST_ARGS "--config=${F3D_TEST_CONFIG}")
Expand Down Expand Up @@ -29,6 +29,10 @@ function(f3d_test)
set(F3D_TEST_LONG_TIMEOUT ON)
endif()

if (F3D_TEST_SCRIPT)
list(APPEND F3D_TEST_ARGS "--command-script=${F3D_SOURCE_DIR}/testing/scripts/${F3D_TEST_SCRIPT}")
endif()

if(F3D_TEST_NO_RENDER)
list(APPEND F3D_TEST_ARGS "--no-render" "--verbose=debug")
else()
Expand Down Expand Up @@ -527,8 +531,7 @@ if(F3D_MODULE_RAYTRACING)
f3d_test(NAME TestRaytracingNoBackground DATA suzanne.ply ARGS -rd --samples=4 --no-background)

else(F3D_MODULE_RAYTRACING)
# XXX: This test is disabled until this code can be reached again using `--command-script`
# f3d_test(NAME TestInteractionRaytracingDenoiseNoRaytracing DATA suzanne.ply INTERACTION NO_BASELINE REGEXP "Raytracing options can't be used if F3D has not been built with raytracing") #RD
f3d_test(NAME TestCommandScriptRaytracingNoRaytracing DATA suzanne.ply SCRIPT TestCommandScriptRaytracing.txt NO_BASELINE REGEXP "Raytracing options can't be used if F3D has not been built with raytracing")
endif()

if(F3D_MODULE_EXR)
Expand Down Expand Up @@ -857,9 +860,9 @@ f3d_test(NAME TestInteractionRecord DATA cow.vtp ARGS --interaction-test-record=
f3d_test(NAME TestInteractionPlay DATA cow.vtp ARGS --interaction-test-play=${CMAKE_BINARY_DIR}/Testing/Temporary/interaction.log DEPENDS TestInteractionRecord NO_BASELINE)

# Command Script Test
f3d_test(NAME TestCommandScriptBasic DATA dragon.vtu ARGS --command-script=${F3D_SOURCE_DIR}/testing/data/TestCommandScriptBasic.txt --ref=${F3D_SOURCE_DIR}/testing/baselines/TestCommandScriptBasic.png)
f3d_test(NAME TestCommandScriptInvalidCommand DATA dragon.vtu ARGS --command-script=${F3D_SOURCE_DIR}/testing/data/TestCommandScriptInvalid.txt REGEXP "Command: \"INVALID_COMMAND_1\" is not recognized, ignoring" NO_BASELINE)
f3d_test(NAME TestCommandScriptMissingFile DATA dragon.vtu ARGS --command-script=${F3D_SOURCE_DIR}/testing/data/TestCommandScriptMissingFile.txt REGEXP "Unable to open command script file" NO_BASELINE)
f3d_test(NAME TestCommandScriptBasic DATA dragon.vtu SCRIPT TestCommandScriptBasic.txt --ref=${F3D_SOURCE_DIR}/testing/baselines/TestCommandScriptBasic.png)
f3d_test(NAME TestCommandScriptInvalidCommand DATA dragon.vtu SCRIPT TestCommandScriptInvalid.txt REGEXP "Command: \"INVALID_COMMAND_1\" is not recognized, ignoring" NO_BASELINE)
f3d_test(NAME TestCommandScriptMissingFile DATA dragon.vtu SCRIPT TestCommandScriptMissingFile.txt REGEXP "Unable to open command script file" NO_BASELINE)

# Window position test
f3d_test(NAME TestPosition DATA dragon.vtu ARGS --position=100,100 NO_BASELINE)
Expand Down
3 changes: 0 additions & 3 deletions testing/data/TestCommandScriptBasic.txt

This file was deleted.

3 changes: 0 additions & 3 deletions testing/data/TestCommandScriptInvalid.txt

This file was deleted.

This file was deleted.

4 changes: 4 additions & 0 deletions testing/scripts/TestCommandScriptBasic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
roll_camera 90
toggle ui.scalar_bar
print_scene_info
increase_light_intensity
1 change: 1 addition & 0 deletions testing/scripts/TestCommandScriptInvalid.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INVALID_COMMAND_1
2 changes: 2 additions & 0 deletions testing/scripts/TestCommandScriptRaytracing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
toggle render.raytracing.enable
toggle render.raytracing.denoise

0 comments on commit 65b224c

Please sign in to comment.