diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7829dd9514..0ef253b628 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,7 +12,7 @@ A clear and concise description of what the bug is, a screenshot helps a lot. **To Reproduce** Steps to reproduce the behavior: - 1. Open the file using `f3d --dry-run example.glb` + 1. Open the file using `f3d --no-config example.glb` 2. step 2 3. step 3 diff --git a/application/F3DOptionsTools.cxx b/application/F3DOptionsTools.cxx index 97c055d3fc..1091f8b127 100644 --- a/application/F3DOptionsTools.cxx +++ b/application/F3DOptionsTools.cxx @@ -67,8 +67,8 @@ static inline const std::array CLIOptions = {{ { "readers-list", "", "Print the list of readers", "", "" }, { "bindings-list", "", "Print the list of interaction bindings and exits, ignored with `--no-render`, only considers the first file group.", "", "" }, { "config", "", "Specify the configuration file to use. absolute/relative path or filename/filestem to search in configuration file locations", "", "" }, - { "dry-run", "", "Do not read the configuration file", "", "1" }, - { "no-render", "", "Do not read the configuration file", "", "1" }, + { "no-config", "", "Do not read the configuration file", "", "1" }, + { "no-render", "", "Do not render anything and quit right after loading the first file, use with --verbose to recover information about a file.", "", "1" }, { "rendering-backend", "", "Backend to use when rendering (auto|glx|wgl|egl|osmesa)", "", "" }, { "max-size", "", "Maximum size in Mib of a file to load, leave empty for unlimited", "", "" }, #if F3D_MODULE_DMON diff --git a/application/F3DOptionsTools.h b/application/F3DOptionsTools.h index bca5b34294..aeda133ce3 100644 --- a/application/F3DOptionsTools.h +++ b/application/F3DOptionsTools.h @@ -30,7 +30,7 @@ static inline const OptionsDict DefaultAppOptions = { { "bindings-list", "false" }, { "no-background", "false" }, { "config", "" }, - { "dry-run", "false" }, + { "no-config", "false" }, { "no-render", "false" }, { "rendering-backend", "auto" }, { "max-size", "" }, diff --git a/application/F3DStarter.cxx b/application/F3DStarter.cxx index fc09605731..150808b25d 100644 --- a/application/F3DStarter.cxx +++ b/application/F3DStarter.cxx @@ -812,17 +812,17 @@ int F3DStarter::Start(int argc, char** argv) // Store in a option entries for easier processing this->Internals->CLIOptionsEntries.emplace_back(cliOptionsDict, fs::path(), "CLI options"); - // Check dry-run, config CLI, output and verbose options first + // Check no-config, config CLI, output and verbose options first // XXX: the local variable are initialized manually for simplicity // but this duplicate the initialization value as it is present in // F3DOptionTools::DefaultAppOptions too - bool dryRun = false; - if (cliOptionsDict.find("no-render") != cliOptionsDict.end()) + bool noConfig = false; + if (cliOptionsDict.find("no-config") != cliOptionsDict.end()) { - dryRun = f3d::options::parse(cliOptionsDict["no-render"]); + noConfig = f3d::options::parse(cliOptionsDict["no-config"]); } std::string config; - if (cliOptionsDict.find("config") != cliOptionsDict.end()) + if (!noConfig && cliOptionsDict.find("config") != cliOptionsDict.end()) { config = f3d::options::parse(cliOptionsDict["config"]); } @@ -844,7 +844,7 @@ int F3DStarter::Start(int argc, char** argv) f3d::log::debug("========== Initializing Options =========="); // Read config files - if (!dryRun) + if (!noConfig) { std::tie(this->Internals->ConfigOptionsEntries, this->Internals->ConfigBindingsEntries) = F3DConfigFileTools::ReadConfigFiles(config); diff --git a/application/testing/CMakeLists.txt b/application/testing/CMakeLists.txt index d491b06555..10121bff51 100644 --- a/application/testing/CMakeLists.txt +++ b/application/testing/CMakeLists.txt @@ -6,7 +6,7 @@ function(f3d_test) if(F3D_TEST_CONFIG) list(APPEND F3D_TEST_ARGS "--config=${F3D_TEST_CONFIG}") else() - list(APPEND F3D_TEST_ARGS "--dry-run") + list(APPEND F3D_TEST_ARGS "--no-config") endif() if (F3D_TEST_DATA) @@ -261,17 +261,17 @@ endif() function(f3d_ss_test) cmake_parse_arguments(F3D_SS_TEST "MINIMAL" "NAME;TEMPLATE;EXPECTED;DEPENDS" "ARGS" ${ARGN}) if(NOT F3D_SS_TEST_MINIMAL) - f3d_test(NAME TestScreenshot${F3D_SS_TEST_NAME} DATA suzanne.ply ARGS --screenshot-filename=${F3D_SS_TEST_TEMPLATE} --dry-run --interaction-test-play=${F3D_SOURCE_DIR}/testing/recordings/TestScreenshot.log NO_BASELINE DEPENDS TestSetupScreenshots) + f3d_test(NAME TestScreenshot${F3D_SS_TEST_NAME} DATA suzanne.ply ARGS --screenshot-filename=${F3D_SS_TEST_TEMPLATE} --no-config --interaction-test-play=${F3D_SOURCE_DIR}/testing/recordings/TestScreenshot.log NO_BASELINE DEPENDS TestSetupScreenshots) f3d_test(NAME TestScreenshot${F3D_SS_TEST_NAME}File DATA suzanne.ply ARGS --reference=${F3D_SS_TEST_EXPECTED} DEPENDS TestScreenshot${F3D_SS_TEST_NAME} ${F3D_SS_TEST_DEPENDS} NO_BASELINE) else() # show filename, axes, fps before the "minimal screenshot" interaction; compare with --no-background only - f3d_test(NAME TestScreenshot${F3D_SS_TEST_NAME} DATA suzanne.ply ARGS --screenshot-filename=${F3D_SS_TEST_TEMPLATE} --dry-run -nxz --interaction-test-play=${F3D_SOURCE_DIR}/testing/recordings/TestScreenshotMinimal.log NO_BASELINE DEPENDS TestSetupScreenshots) + f3d_test(NAME TestScreenshot${F3D_SS_TEST_NAME} DATA suzanne.ply ARGS --screenshot-filename=${F3D_SS_TEST_TEMPLATE} --no-config -nxz --interaction-test-play=${F3D_SOURCE_DIR}/testing/recordings/TestScreenshotMinimal.log NO_BASELINE DEPENDS TestSetupScreenshots) f3d_test(NAME TestScreenshot${F3D_SS_TEST_NAME}File DATA suzanne.ply ARGS --no-background --reference=${F3D_SS_TEST_EXPECTED} DEPENDS TestScreenshot${F3D_SS_TEST_NAME} ${F3D_SS_TEST_DEPENDS} NO_BASELINE) endif() endfunction() function(f3d_ss_template_test) cmake_parse_arguments(F3D_SS_TEMPLATE_TEST "" "NAME;TEMPLATE;EXPECTED_REGEX" "ARGS" ${ARGN}) - f3d_test(NAME TestScreenshot${F3D_SS_TEMPLATE_TEST_NAME} DATA suzanne.ply ARGS --screenshot-filename=${F3D_SS_TEMPLATE_TEST_TEMPLATE} --dry-run --interaction-test-play=${F3D_SOURCE_DIR}/testing/recordings/TestScreenshot.log + f3d_test(NAME TestScreenshot${F3D_SS_TEMPLATE_TEST_NAME} DATA suzanne.ply ARGS --screenshot-filename=${F3D_SS_TEMPLATE_TEST_TEMPLATE} --no-config --interaction-test-play=${F3D_SOURCE_DIR}/testing/recordings/TestScreenshot.log REGEXP "saving screenshot to .+[/\\]${F3D_SS_TEMPLATE_TEST_EXPECTED_REGEX}" NO_BASELINE DEPENDS TestSetupScreenshots) endfunction() @@ -1058,6 +1058,9 @@ f3d_test(NAME TestConfigFileQuiet DATA nonExistentFile.vtp CONFIG ${F3D_SOURCE_D # Test no file with config file f3d_test(NAME TestNoFileConfigFile CONFIG ${F3D_SOURCE_DIR}/testing/configs/verbose.json ARGS --verbose REGEXP "No files to load provided" NO_BASELINE) +# Test that --no-config overrides --config +f3d_test(NAME TestNoConfigWithConfig DATA f3d.glb ARGS --no-config --config ${F3D_SOURCE_DIR}/testing/configs/complex.json) + # Test help display f3d_test(NAME TestHelp ARGS --help REGEXP "Usage:") f3d_test(NAME TestHelpPositional ARGS --help REGEXP "file1 file2 \.\.\.") @@ -1113,8 +1116,8 @@ endif() f3d_test(NAME TestRenderingBackendInvalid DATA cow.vtp RENDERING_BACKEND invalid ARGS --verbose REGEXP "rendering-backend value is invalid, falling back to" NO_BASELINE) # Test that f3d can try to read a system config file -add_test(NAME f3d::TestNoDryRun COMMAND $ --no-render) -set_tests_properties(f3d::TestNoDryRun PROPERTIES TIMEOUT 4) +add_test(NAME f3d::TestNoNoConfig COMMAND $ --no-render) +set_tests_properties(f3d::TestNoNoConfig PROPERTIES TIMEOUT 4) # Test invalid CLI args add_test(NAME f3d::TestInvalidCLIArgs COMMAND $ --up) diff --git a/doc/user/CONFIGURATION_FILE.md b/doc/user/CONFIGURATION_FILE.md index 997f2a465d..9554ff51e6 100644 --- a/doc/user/CONFIGURATION_FILE.md +++ b/doc/user/CONFIGURATION_FILE.md @@ -65,7 +65,7 @@ The third block specifies raytracing usage for .gltf and .glb files. The last block specifies that volume rendering should be used with .mhd files. The following options cannot be set via config file: -`help`, `version`, `readers-list`, `config`, `dry-run` and `input`. +`help`, `version`, `readers-list`, `config`, `no-config` and `input`. The following options are only taken on the first load: `no-render`, `output`, `position`, `resolution`, `frame-rate` and all testing options. diff --git a/doc/user/OPTIONS.md b/doc/user/OPTIONS.md index 80e79ace97..576fdbd723 100644 --- a/doc/user/OPTIONS.md +++ b/doc/user/OPTIONS.md @@ -15,7 +15,7 @@ Options|Type
Default|Description \-\-version||Show *version* information and exit. Ignore `--verbose`. \-\-readers-list||List available *readers* and exit. Ignore `--verbose`. \-\-config=\|string
config|Specify the [configuration file](CONFIGURATION_FILE.md) to use. Supports absolute/relative path but also filename/filestem to search for in standard configuration file locations. -\-\-dry-run|bool
false|Do not read any configuration file and consider only the command line options. +\-\-no-config|bool
false|Do not read any configuration file and consider only the command line options. \-\-no-render|bool
false|Do not render anything and quit just after loading the first file, use with \-\-verbose to recover information about a file. \-\-max-size=\|int
-1|Prevent F3D to load a file bigger than the provided size in Mib, leave empty for unlimited, useful for thumbnails. \-\-watch|bool
false|Watch current file and automatically reload it whenever it is modified on disk. diff --git a/examples/plugins/example-plugin/CMakeLists.txt b/examples/plugins/example-plugin/CMakeLists.txt index 2c850e1429..7a5d2d8579 100644 --- a/examples/plugins/example-plugin/CMakeLists.txt +++ b/examples/plugins/example-plugin/CMakeLists.txt @@ -32,7 +32,7 @@ if(BUILD_TESTING) find_package(f3d REQUIRED COMPONENTS application) add_test(NAME TestPluginExample COMMAND "$" - "--dry-run" + "--no-config" "--no-render" "--verbose" "--load-plugins=$" diff --git a/testing/baselines/TestInteractionConsoleInvalidCommand.png b/testing/baselines/TestInteractionConsoleInvalidCommand.png index bb540da6e2..331af8cf42 100644 --- a/testing/baselines/TestInteractionConsoleInvalidCommand.png +++ b/testing/baselines/TestInteractionConsoleInvalidCommand.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1b8bc75d471af40c140975178da3f94e924f952a2521741c12139f3d9f9edf54 -size 9652 +oid sha256:6c197aa42c7e0cebadd8386647cf3f9150374c0a291f61ae287a9b1940569a2e +size 7033 diff --git a/testing/baselines/TestInteractionConsoleInvalidOption.png b/testing/baselines/TestInteractionConsoleInvalidOption.png index 1eb88caa88..ad9c3ab513 100644 --- a/testing/baselines/TestInteractionConsoleInvalidOption.png +++ b/testing/baselines/TestInteractionConsoleInvalidOption.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6ef51fdb21b776bc6aeb6032787de26cc775b1036dae1f6ab41b45b7173bf128 -size 10405 +oid sha256:46342d6e8286a5d4e47d2fdb09597e462fcf0019fd5534370e2bf7b071ecea29 +size 7650 diff --git a/testing/baselines/TestInteractionConsoleOpen.png b/testing/baselines/TestInteractionConsoleOpen.png index 47592b6e32..9397900687 100644 --- a/testing/baselines/TestInteractionConsoleOpen.png +++ b/testing/baselines/TestInteractionConsoleOpen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:66f8eecd4c96e665f9823dc4ab1c3ca183576b7c9607369ff7780536c106ec58 -size 6006 +oid sha256:22c40eacebf62a9cf657533f6bbb584a81ae2cf79ef7db9267a65c7520a8b508 +size 2943 diff --git a/testing/baselines/TestInteractionConsoleOpenWarningClick.png b/testing/baselines/TestInteractionConsoleOpenWarningClick.png index 510982cd28..d0bd481370 100644 --- a/testing/baselines/TestInteractionConsoleOpenWarningClick.png +++ b/testing/baselines/TestInteractionConsoleOpenWarningClick.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e33eac7efbb0ed521f695360b46b18fd56ae8ae3db9f77208def914dab8bc62f -size 9990 +oid sha256:5b616c40fe3aa42bdc75117f67993c739251e8412c400285e0a0b9671300bd7b +size 6981 diff --git a/testing/baselines/TestInteractionConsoleOpenWarningKeyboard.png b/testing/baselines/TestInteractionConsoleOpenWarningKeyboard.png index 510982cd28..d0bd481370 100644 --- a/testing/baselines/TestInteractionConsoleOpenWarningKeyboard.png +++ b/testing/baselines/TestInteractionConsoleOpenWarningKeyboard.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e33eac7efbb0ed521f695360b46b18fd56ae8ae3db9f77208def914dab8bc62f -size 9990 +oid sha256:5b616c40fe3aa42bdc75117f67993c739251e8412c400285e0a0b9671300bd7b +size 6981 diff --git a/testing/baselines/TestInteractionConsoleTypingSceneInfo.png b/testing/baselines/TestInteractionConsoleTypingSceneInfo.png index dbed4155a5..8e05e64365 100644 --- a/testing/baselines/TestInteractionConsoleTypingSceneInfo.png +++ b/testing/baselines/TestInteractionConsoleTypingSceneInfo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60429b4d5f4bca808f06f2d0e5c3c3c16e1fa9c91e10219b742ecdd2e2f7be0b -size 20431 +oid sha256:ab2ccb17632c90d069ff787745b21ca13f12cc5f6d5e1f0fc288d1a1e1cf9298 +size 19869 diff --git a/testing/baselines/TestNoConfigWithConfig.png b/testing/baselines/TestNoConfigWithConfig.png new file mode 100644 index 0000000000..77fae834e5 --- /dev/null +++ b/testing/baselines/TestNoConfigWithConfig.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31003beb4deaafa6ff52087151b314d27721d31d357a322d06dd7fab6d950162 +size 2420