Skip to content

Commit

Permalink
interaction-test: Add HOME support
Browse files Browse the repository at this point in the history
  • Loading branch information
mwestphal committed Dec 28, 2024
1 parent 51f316d commit b64bfce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 2 additions & 4 deletions application/F3DStarter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,7 @@ int F3DStarter::Start(int argc, char** argv)
}

// Play recording if any
const std::string& interactionTestPlayFile =
this->Internals->AppOptions.InteractionTestPlayFile;
fs::path interactionTestPlayFile(f3d::utils::collapsePath(this->Internals->AppOptions.InteractionTestPlayFile));
if (!interactionTestPlayFile.empty())
{
// For better testing, render once before the interaction
Expand All @@ -958,8 +957,7 @@ int F3DStarter::Start(int argc, char** argv)
}

// Start recording if needed
const std::string& interactionTestRecordFile =
this->Internals->AppOptions.InteractionTestRecordFile;
fs::path interactionTestRecordFile(f3d::utils::collapsePath(this->Internals->AppOptions.InteractionTestRecordFile));
if (!interactionTestRecordFile.empty())
{
if (!interactor.recordInteraction(interactionTestRecordFile))
Expand Down
8 changes: 5 additions & 3 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -877,11 +877,11 @@ f3d_test(NAME TestUnsupportedInputOutput DATA unsupportedFile.dummy REGEXP "No f
f3d_test(NAME TestOutputNoBackground DATA cow.vtp ARGS --no-background NO_BASELINE)

# Test Non existent interaction record directory
f3d_test(NAME TestInteractionNonExistentRecordDirectory ARGS --interaction-test-record=${CMAKE_BINARY_DIR}/Testing/NotExistentDirectory/interaction.log NO_BASELINE REGEXP "Interaction record directory does not exist")
f3d_test(NAME TestInteractionNonExistentRecordDirectory ARGS --interaction-test-record=${CMAKE_BINARY_DIR}/Testing/NotExistentDirectory/TestInteractionNonExistentRecordDirectory.log NO_BASELINE REGEXP "Interaction record directory does not exist")

# Basic record and play test
f3d_test(NAME TestInteractionRecord DATA cow.vtp ARGS --interaction-test-record=${CMAKE_BINARY_DIR}/Testing/Temporary/interaction.log NO_BASELINE)
f3d_test(NAME TestInteractionPlay DATA cow.vtp ARGS --interaction-test-play=${CMAKE_BINARY_DIR}/Testing/Temporary/interaction.log DEPENDS TestInteractionRecord NO_BASELINE)
f3d_test(NAME TestInteractionRecord DATA cow.vtp ARGS --interaction-test-record=${CMAKE_BINARY_DIR}/Testing/Temporary/TestInteractionRecord.log NO_BASELINE)
f3d_test(NAME TestInteractionPlay DATA cow.vtp ARGS --interaction-test-play=${CMAKE_BINARY_DIR}/Testing/Temporary/TestInteractionRecord.log DEPENDS TestInteractionRecord NO_BASELINE)

# Command Script Test
f3d_test(NAME TestCommandScriptBasic DATA dragon.vtu SCRIPT TestCommandScriptBasic.txt --reference=${F3D_SOURCE_DIR}/testing/baselines/TestCommandScriptBasic.png)
Expand Down Expand Up @@ -1147,6 +1147,8 @@ if(NOT WIN32)
f3d_test(NAME TestHOMEInput ARGS --input=~/testing/data/suzanne.stl ENV "HOME=${F3D_SOURCE_DIR}")
f3d_test(NAME TestHOMEConfig DATA suzanne.stl CONFIG ~/testing/configs/complex.json ENV "HOME=${F3D_SOURCE_DIR}")
f3d_test(NAME TestHOMEPlugin ARGS --load-plugins=~/testing/data/invalid.so REGEXP "Cannot open the library" NO_BASELINE ENV "HOME=${F3D_SOURCE_DIR}")
f3d_test(NAME TestHOMEInteractionRecord DATA cow.vtp ARGS --interaction-test-record=~/Testing/Temporary/TestHOMEInteractionRecord.log NO_BASELINE ENV "HOME=${CMAKE_BINARY_DIR}")
f3d_test(NAME TestHOMEInteractionPlay DATA cow.vtp ARGS --interaction-test-play=~/Testing/Temporary/TestHOMEInteractionRecord.log DEPENDS TestHOMEInteractionRecord NO_BASELINE ENV "HOME=${CMAKE_BINARY_DIR}")
endif()

# Test failure without a reference, please do not create a TestNoRef.png file
Expand Down

0 comments on commit b64bfce

Please sign in to comment.