From c3eb2e1e06f666503bb2d5a80d735187d29a8605 Mon Sep 17 00:00:00 2001 From: Mathieu Westphal Date: Thu, 28 Nov 2024 22:36:03 +0100 Subject: [PATCH] Config: Change syntax and updates all configs (#1730) Change config file syntax to: ``` [ { "options": { "filename": true, "camera-direction": "-1,-0.5,-1", "hdri-ambient": true, "translucency-support": true, "animation-progress": true } }, { "match": ".*obj", "options": { "axis": true, "tone-mapping": true } } ] ``` also adds a test and updates doc --- application/F3DConfigFileTools.cxx | 72 ++++++++++++++----- application/testing/CMakeLists.txt | 6 ++ doc/user/CONFIGURATION_FILE.md | 63 +++++++++------- doc/user/PLUGINS.md | 10 ++- .../configs/config.d/10_example.json | 5 +- .../configs/thumbnail.d/10_example.json | 5 +- .../alembic/configs/config.d/10_alembic.json | 5 +- .../configs/thumbnail.d/10_alembic.json | 5 +- .../assimp/configs/config.d/10_assimp.json | 19 +++-- .../assimp/configs/thumbnail.d/10_assimp.json | 19 +++-- plugins/draco/configs/config.d/10_draco.json | 5 +- .../draco/configs/thumbnail.d/10_draco.json | 5 +- .../exodus/configs/config.d/10_exodus.json | 5 +- .../exodus/configs/thumbnail.d/10_exodus.json | 5 +- .../native/configs/config.d/10_native.json | 47 ++++++++---- .../native/configs/thumbnail.d/10_native.json | 33 ++++++--- plugins/occt/configs/config.d/10_occt.json | 5 +- plugins/occt/configs/thumbnail.d/10_occt.json | 5 +- plugins/usd/configs/config.d/10_usd.json | 5 +- plugins/usd/configs/thumbnail.d/10_usd.json | 5 +- plugins/vdb/configs/config.d/10_vdb.json | 5 +- plugins/vdb/configs/thumbnail.d/10_vdb.json | 5 +- resources/configs/config.d/05_all.json | 4 +- resources/configs/thumbnail.d/05_all.json | 4 +- testing/configs/checkerboard_colorful.json | 4 +- testing/configs/complex.json | 25 +++++-- testing/configs/config_order.json | 12 +++- testing/configs/exodus.json | 5 +- testing/configs/hdri.json.in | 4 +- testing/configs/inexistent_key.json | 10 +-- testing/configs/invalid_options.json | 3 + testing/configs/invalid_value.json | 10 +-- testing/configs/no_options.json | 8 +++ testing/configs/nonparsable_value.json | 10 +-- testing/configs/quiet.json | 4 +- testing/configs/resolution.json | 11 ++- testing/configs/verbose.json | 4 +- 37 files changed, 336 insertions(+), 121 deletions(-) create mode 100644 testing/configs/invalid_options.json create mode 100644 testing/configs/no_options.json diff --git a/application/F3DConfigFileTools.cxx b/application/F3DConfigFileTools.cxx index 3ec7766f42..545f9fe8a1 100644 --- a/application/F3DConfigFileTools.cxx +++ b/application/F3DConfigFileTools.cxx @@ -169,7 +169,7 @@ F3DOptionsTools::OptionsEntries F3DConfigFileTools::ReadConfigFiles(const std::s { file >> json; } - catch (const std::exception& ex) + catch (const nlohmann::json::parse_error& ex) { f3d::log::error( "Unable to parse the configuration file ", configFilePath.string(), " , ignoring it"); @@ -177,31 +177,71 @@ F3DOptionsTools::OptionsEntries F3DConfigFileTools::ReadConfigFiles(const std::s continue; } - // For each config "pattern" - for (const auto& configBlock : json.items()) + try { - // Add each config entry into an option dict - F3DOptionsTools::OptionsDict entry; - for (const auto& item : configBlock.value().items()) + // For each config block in the main array + for (const auto& configBlock : json) { - if (item.value().is_number() || item.value().is_boolean()) + // Recover match if any + std::string match; + try + { + match = configBlock.at("match"); + } + catch (nlohmann::json::out_of_range&) + { + // No match defined, use a catch all regex + match = ".*"; + } + + // Recover options if any + nlohmann::ordered_json optionsBlock; + try + { + optionsBlock = configBlock.at("options"); + } + catch (nlohmann::json::out_of_range&) { - entry[item.key()] = nlohmann::to_string(item.value()); } - else if (item.value().is_string()) + + if (optionsBlock.empty()) { - entry[item.key()] = item.value().get(); + // To help users figure out issues with configuration files + f3d::log::warn("A config block in config file: ", configFilePath.string(), + " does not contains options, ignoring block"); } else { - f3d::log::error(item.key(), " from ", configFilePath.string(), - " must be a string, a boolean or a number, ignoring entry"); - continue; + // Add each options config entry into an option dict + F3DOptionsTools::OptionsDict entry; + for (const auto& item : optionsBlock.items()) + { + if (item.value().is_number() || item.value().is_boolean()) + { + entry[item.key()] = nlohmann::to_string(item.value()); + } + else if (item.value().is_string()) + { + entry[item.key()] = item.value().get(); + } + else + { + f3d::log::error(item.key(), " from ", configFilePath.string(), + " must be a string, a boolean or a number, ignoring entry"); + continue; + } + } + + // Emplace the option dict for that pattern match into the config entries vector + confEntries.emplace_back(entry, configFilePath, match); } } - - // Emplace the option dict for that pattern into the config entries vector - confEntries.emplace_back(entry, configFilePath, configBlock.key()); + } + catch (const nlohmann::json::type_error& ex) + { + f3d::log::warn("Error processing config file: ", configFilePath.string(), + ", configuration may be incorrect"); + f3d::log::error(ex.what()); } } return confEntries; diff --git a/application/testing/CMakeLists.txt b/application/testing/CMakeLists.txt index 9164bc1343..56aba7672d 100644 --- a/application/testing/CMakeLists.txt +++ b/application/testing/CMakeLists.txt @@ -994,6 +994,12 @@ f3d_test(NAME TestInvalidMultiFileMode DATA mb/recursive ARGS --multi-file-mode= f3d_test(NAME TestVerboseUnnamedCamera DATA Cameras.gltf ARGS --verbose REGEXP "1: unnamed_1" NO_BASELINE) f3d_test(NAME TestVerboseUnnamedAnimation DATA BoxAnimated.gltf ARGS --verbose REGEXP "0: unnamed_0" NO_BASELINE) +# Test invalid value in config file +f3d_test(NAME TestConfigFileInvalidOptions DATA cow.vtp CONFIG ${F3D_SOURCE_DIR}/testing/configs/invalid_options.json REGEXP "Error processing config file" NO_BASELINE) + +# Test invalid value in config file +f3d_test(NAME TestConfigFileNoOptions DATA cow.vtp CONFIG ${F3D_SOURCE_DIR}/testing/configs/no_options.json REGEXP "does not contains options" NO_BASELINE) + # Test invalid value in config file f3d_test(NAME TestConfigFileInvalidValue DATA cow.vtp CONFIG ${F3D_SOURCE_DIR}/testing/configs/invalid_value.json REGEXP "must be a string, a boolean or a number" NO_BASELINE) diff --git a/doc/user/CONFIGURATION_FILE.md b/doc/user/CONFIGURATION_FILE.md index 6d6a0d3324..4957678a8a 100644 --- a/doc/user/CONFIGURATION_FILE.md +++ b/doc/user/CONFIGURATION_FILE.md @@ -10,37 +10,52 @@ in order to provide different default values for the different filetypes. Using a command-line option will override similar option set in any config files. -Some options are only taken into account on the first load and not on subsequent loads, +Some options are only taken into account on the first load and not on subsequent loads, when switching between files. A typical config file may look like this: ```javascript +[ { - ".*": { - "bg-color": "0.7,0.7,0.7", - "color": "0.5,0.1,0.1", - "anti-aliasing": true, - "timer": true, - "progress": true, - "axis": true, - "bar": true, - "roughness": 0.2, - "grid": true, - "scalar-coloring": true - }, - ".*vt.": { - "edges": true - }, - ".*gl(tf|b)": { - "raytracing": true, - "denoise": true, - "samples": 3 - }, - ".*mhd": { - "volume": true - } + "options": + { + "bg-color": "0.7,0.7,0.7", + "color": "0.5,0.1,0.1", + "anti-aliasing": true, + "timer": true, + "progress": true, + "axis": true, + "bar": true, + "roughness": 0.2, + "grid": true, + "scalar-coloring": true + } +}, +{ + "match": ".*vt.", + "options": + { + "edges": true + } +}, +{ + "match": ".*gl(tf|b)", + "options": + { + "raytracing": true, + "denoise": true, + "samples": 3 + } +}, +{ + "match": ".*mhd", + "options": + { + "volume": true + } } +] ``` Here, the first block defines a basic configuration with many desired options for all files. The second block specifies that all files ending with vt., eg: vtk, vtp, vtu, ... will be shown with edges visibility turned on. diff --git a/doc/user/PLUGINS.md b/doc/user/PLUGINS.md index 8e552a98c5..fdf8a25ac5 100644 --- a/doc/user/PLUGINS.md +++ b/doc/user/PLUGINS.md @@ -17,11 +17,15 @@ Alternatively, you can add your plugin directly in the multiple plugins in a single comma-separated list, like in the example below: ``` +[ { - ".*(file_extension)": { - "load-plugins": "plugin1", "plugin2" - } + "match": ".*(file_extension)", + "options": + { + "load-plugins": "plugin1", "plugin2" + } } +] ``` ### Supported plugins diff --git a/examples/plugins/example-plugin/configs/config.d/10_example.json b/examples/plugins/example-plugin/configs/config.d/10_example.json index 1b226d3b7c..1e7ce830fe 100644 --- a/examples/plugins/example-plugin/configs/config.d/10_example.json +++ b/examples/plugins/example-plugin/configs/config.d/10_example.json @@ -1,6 +1,9 @@ +[ { - ".*(expl)": + "match": ".*(expl)", + "options": { "load-plugins": "example" } } +] diff --git a/examples/plugins/example-plugin/configs/thumbnail.d/10_example.json b/examples/plugins/example-plugin/configs/thumbnail.d/10_example.json index 1b226d3b7c..1e7ce830fe 100644 --- a/examples/plugins/example-plugin/configs/thumbnail.d/10_example.json +++ b/examples/plugins/example-plugin/configs/thumbnail.d/10_example.json @@ -1,6 +1,9 @@ +[ { - ".*(expl)": + "match": ".*(expl)", + "options": { "load-plugins": "example" } } +] diff --git a/plugins/alembic/configs/config.d/10_alembic.json b/plugins/alembic/configs/config.d/10_alembic.json index 286f47fe09..e7b2409164 100644 --- a/plugins/alembic/configs/config.d/10_alembic.json +++ b/plugins/alembic/configs/config.d/10_alembic.json @@ -1,7 +1,10 @@ +[ { - ".*(abc)": + "match": ".*(abc)", + "options": { "scalar-coloring": true, "load-plugins": "alembic" } } +] diff --git a/plugins/alembic/configs/thumbnail.d/10_alembic.json b/plugins/alembic/configs/thumbnail.d/10_alembic.json index 286f47fe09..e7b2409164 100644 --- a/plugins/alembic/configs/thumbnail.d/10_alembic.json +++ b/plugins/alembic/configs/thumbnail.d/10_alembic.json @@ -1,7 +1,10 @@ +[ { - ".*(abc)": + "match": ".*(abc)", + "options": { "scalar-coloring": true, "load-plugins": "alembic" } } +] diff --git a/plugins/assimp/configs/config.d/10_assimp.json b/plugins/assimp/configs/config.d/10_assimp.json index 496cb15073..a6d6be1b30 100644 --- a/plugins/assimp/configs/config.d/10_assimp.json +++ b/plugins/assimp/configs/config.d/10_assimp.json @@ -1,16 +1,25 @@ +[ { - ".*(fbx|dae|off|dxf|x|3mf)": + "match": ".*(fbx|dae|off|dxf|x|3mf)", + "options": { "load-plugins": "assimp" - }, - ".*(off|3mf)": + } +}, +{ + "match": ".*(off|3mf)", + "options": { "up": "+Z", "camera-direction": "-1,1,-0.5" - }, - ".*(dxf)": + } +}, +{ + "match": ".*(dxf)", + "options": { "up": "-Z", "camera-direction": "1,-1,0.5" } } +] diff --git a/plugins/assimp/configs/thumbnail.d/10_assimp.json b/plugins/assimp/configs/thumbnail.d/10_assimp.json index 496cb15073..a6d6be1b30 100644 --- a/plugins/assimp/configs/thumbnail.d/10_assimp.json +++ b/plugins/assimp/configs/thumbnail.d/10_assimp.json @@ -1,16 +1,25 @@ +[ { - ".*(fbx|dae|off|dxf|x|3mf)": + "match": ".*(fbx|dae|off|dxf|x|3mf)", + "options": { "load-plugins": "assimp" - }, - ".*(off|3mf)": + } +}, +{ + "match": ".*(off|3mf)", + "options": { "up": "+Z", "camera-direction": "-1,1,-0.5" - }, - ".*(dxf)": + } +}, +{ + "match": ".*(dxf)", + "options": { "up": "-Z", "camera-direction": "1,-1,0.5" } } +] diff --git a/plugins/draco/configs/config.d/10_draco.json b/plugins/draco/configs/config.d/10_draco.json index 8428b17b2a..f5c9e6c553 100644 --- a/plugins/draco/configs/config.d/10_draco.json +++ b/plugins/draco/configs/config.d/10_draco.json @@ -1,7 +1,10 @@ +[ { - ".*(drc)": + "match": ".*(drc)", + "options": { "scalar-coloring": true, "load-plugins": "draco" } } +] diff --git a/plugins/draco/configs/thumbnail.d/10_draco.json b/plugins/draco/configs/thumbnail.d/10_draco.json index 8428b17b2a..f5c9e6c553 100644 --- a/plugins/draco/configs/thumbnail.d/10_draco.json +++ b/plugins/draco/configs/thumbnail.d/10_draco.json @@ -1,7 +1,10 @@ +[ { - ".*(drc)": + "match": ".*(drc)", + "options": { "scalar-coloring": true, "load-plugins": "draco" } } +] diff --git a/plugins/exodus/configs/config.d/10_exodus.json b/plugins/exodus/configs/config.d/10_exodus.json index 4356640057..bff22ed3cb 100644 --- a/plugins/exodus/configs/config.d/10_exodus.json +++ b/plugins/exodus/configs/config.d/10_exodus.json @@ -1,8 +1,11 @@ +[ { - ".*(ex2)": + "match": ".*(ex2)", + "options": { "scalar-coloring": true, "load-plugins": "exodus", "bar": true } } +] diff --git a/plugins/exodus/configs/thumbnail.d/10_exodus.json b/plugins/exodus/configs/thumbnail.d/10_exodus.json index a9881e23ce..dcff006492 100644 --- a/plugins/exodus/configs/thumbnail.d/10_exodus.json +++ b/plugins/exodus/configs/thumbnail.d/10_exodus.json @@ -1,7 +1,10 @@ +[ { - ".*(ex2)": + "match": ".*(ex2)", + "options": { "scalar-coloring": true, "load-plugins": "exodus" } } +] diff --git a/plugins/native/configs/config.d/10_native.json b/plugins/native/configs/config.d/10_native.json index 46be768c6a..6ef10f0f5c 100644 --- a/plugins/native/configs/config.d/10_native.json +++ b/plugins/native/configs/config.d/10_native.json @@ -1,36 +1,56 @@ +[ { - ".*(dcm|nrrd|nhdr|mhd|mha|vt.)": + "match": ".*(dcm|nrrd|nhdr|mhd|mha|vt.)", + "options": { "scalar-coloring": true, "bar": true - }, - ".*(dcm|nrrd|nhdr|mhd|mha|vti)": + } +}, +{ + "match": ".*(dcm|nrrd|nhdr|mhd|mha|vti)", + "options": { "volume": true - }, - ".*(3ds|stl)": + } +}, +{ + "match": ".*(3ds|stl)", + "options": { "up": "+Z", "camera-direction": "-1,1,-0.5" - }, - ".*(stl|gml|pts)": + } +}, +{ + "match": ".*(stl|gml|pts)", + "options": { "scalar-coloring": true - }, - ".*(tif|tiff)": + } +}, +{ + "match": ".*(tif|tiff)", + "options": { "scalar-coloring": true, "up": "-Y", "comp": "-2", "camera-direction": "-1,0.5,1" - }, - ".*(ply)": + } +}, +{ + "match": ".*(ply)", + "options": { "scalar-coloring": true, "comp": "-2", "translucency-support": true - }, - ".*(splat)": + } +}, +{ + "match": ".*(splat)", + "options": { "point-sprites": true, "point-sprites-size": 1, @@ -49,3 +69,4 @@ "translucency-support": false } } +] diff --git a/plugins/native/configs/thumbnail.d/10_native.json b/plugins/native/configs/thumbnail.d/10_native.json index 4e1fba656e..28751f29c4 100644 --- a/plugins/native/configs/thumbnail.d/10_native.json +++ b/plugins/native/configs/thumbnail.d/10_native.json @@ -1,25 +1,39 @@ +[ { - ".*(dcm|nrrd|mhd|mha|vti)": + "match": ".*(dcm|nrrd|mhd|mha|vti)", + "options": { "scalar-coloring": true, "volume": true - }, - ".*(3ds|stl)": + } +}, +{ + "match": ".*(3ds|stl)", + "options": { "up": "+Z", "camera-direction": "-1,1,-0.5" - }, - ".*(stl|gml|pts|vt.)": + } +}, +{ + "match": ".*(stl|gml|pts|vt.)", + "options": { "scalar-coloring": true - }, - ".*(ply)": + } +}, +{ + "match": ".*(ply)", + "options": { "scalar-coloring": true, "comp": "-2", "translucency-support": true - }, - ".*(splat)": + } +}, +{ + "match": ".*(splat)", + "options": { "point-sprites": true, "point-sprites-size": 1, @@ -36,3 +50,4 @@ "translucency-support": false } } +] diff --git a/plugins/occt/configs/config.d/10_occt.json b/plugins/occt/configs/config.d/10_occt.json index f14624bd71..425c8b8f15 100644 --- a/plugins/occt/configs/config.d/10_occt.json +++ b/plugins/occt/configs/config.d/10_occt.json @@ -1,5 +1,7 @@ +[ { - ".*(step|stp|iges|igs|brep|xbf)": + "match": ".*(step|stp|iges|igs|brep|xbf)", + "options": { "scalar-coloring": true, "load-plugins": "occt", @@ -10,3 +12,4 @@ "camera-direction": "-1,1,-0.5" } } +] diff --git a/plugins/occt/configs/thumbnail.d/10_occt.json b/plugins/occt/configs/thumbnail.d/10_occt.json index f14624bd71..425c8b8f15 100644 --- a/plugins/occt/configs/thumbnail.d/10_occt.json +++ b/plugins/occt/configs/thumbnail.d/10_occt.json @@ -1,5 +1,7 @@ +[ { - ".*(step|stp|iges|igs|brep|xbf)": + "match": ".*(step|stp|iges|igs|brep|xbf)", + "options": { "scalar-coloring": true, "load-plugins": "occt", @@ -10,3 +12,4 @@ "camera-direction": "-1,1,-0.5" } } +] diff --git a/plugins/usd/configs/config.d/10_usd.json b/plugins/usd/configs/config.d/10_usd.json index 794a2c0337..a4f2166e85 100644 --- a/plugins/usd/configs/config.d/10_usd.json +++ b/plugins/usd/configs/config.d/10_usd.json @@ -1,6 +1,9 @@ +[ { - ".*(usd)[acz]?": + "match": ".*(usd)[acz]?", + "options": { "load-plugins": "usd" } } +] diff --git a/plugins/usd/configs/thumbnail.d/10_usd.json b/plugins/usd/configs/thumbnail.d/10_usd.json index 794a2c0337..a4f2166e85 100644 --- a/plugins/usd/configs/thumbnail.d/10_usd.json +++ b/plugins/usd/configs/thumbnail.d/10_usd.json @@ -1,6 +1,9 @@ +[ { - ".*(usd)[acz]?": + "match": ".*(usd)[acz]?", + "options": { "load-plugins": "usd" } } +] diff --git a/plugins/vdb/configs/config.d/10_vdb.json b/plugins/vdb/configs/config.d/10_vdb.json index 45a7db3704..270834cfb9 100644 --- a/plugins/vdb/configs/config.d/10_vdb.json +++ b/plugins/vdb/configs/config.d/10_vdb.json @@ -1,8 +1,11 @@ +[ { - ".*(vdb)": + "match": ".*(vdb)", + "options": { "load-plugins": "vdb", "volume": true, "inverse": true } } +] diff --git a/plugins/vdb/configs/thumbnail.d/10_vdb.json b/plugins/vdb/configs/thumbnail.d/10_vdb.json index 45a7db3704..270834cfb9 100644 --- a/plugins/vdb/configs/thumbnail.d/10_vdb.json +++ b/plugins/vdb/configs/thumbnail.d/10_vdb.json @@ -1,8 +1,11 @@ +[ { - ".*(vdb)": + "match": ".*(vdb)", + "options": { "load-plugins": "vdb", "volume": true, "inverse": true } } +] diff --git a/resources/configs/config.d/05_all.json b/resources/configs/config.d/05_all.json index 863318b5e9..270d21481f 100644 --- a/resources/configs/config.d/05_all.json +++ b/resources/configs/config.d/05_all.json @@ -1,5 +1,6 @@ +[ { - ".*": + "options": { "axis": true, "tone-mapping": true, @@ -13,3 +14,4 @@ "animation-progress": true } } +] diff --git a/resources/configs/thumbnail.d/05_all.json b/resources/configs/thumbnail.d/05_all.json index edf80c7da0..a0d1a6c477 100644 --- a/resources/configs/thumbnail.d/05_all.json +++ b/resources/configs/thumbnail.d/05_all.json @@ -1,5 +1,6 @@ +[ { - ".*": + "options": { "anti-aliasing": true, "camera-direction": "-1,-0.5,-1", @@ -11,3 +12,4 @@ "translucency-support": true } } +] diff --git a/testing/configs/checkerboard_colorful.json b/testing/configs/checkerboard_colorful.json index af0a588b13..b8c70c96e4 100644 --- a/testing/configs/checkerboard_colorful.json +++ b/testing/configs/checkerboard_colorful.json @@ -1,8 +1,10 @@ +[ { - ".*":{ + "options":{ "camera-position":"0,45,22", "camera-focal-point":"0,0,0", "camera-view-up":"0,-1,1", "camera-view-angle":16 } } +] diff --git a/testing/configs/complex.json b/testing/configs/complex.json index 177d1d77ea..bca4425f2c 100644 --- a/testing/configs/complex.json +++ b/testing/configs/complex.json @@ -1,23 +1,33 @@ +[ { - ".*": + "options": { "scalar-coloring": true, "interactor.axis": true, "grid": true - }, - ".*(vt.)": + } +}, +{ + "match": ".*(vt.)", + "options": { "up": "+Y", "bar": true, "render.effect.ambient_occlusion": true, "filename": true - }, - ".*(vti)": + } +}, +{ + "match": ".*(vti)", + "options": { "grid": true, "volume": true - }, - ".*(stl)": + } +}, +{ + "match": ".*(stl)", + "options": { "grid": true, "up": "+Z", @@ -25,3 +35,4 @@ "filename": false } } +] diff --git a/testing/configs/config_order.json b/testing/configs/config_order.json index 98246b9845..4cea1a4053 100644 --- a/testing/configs/config_order.json +++ b/testing/configs/config_order.json @@ -1,8 +1,14 @@ +[ { - ".+": { + "match": ".+", + "options": { "bg-color": "1.0, 0.0, 0.0" - }, - ".*": { + } +}, +{ + "match": ".*", + "options": { "bg-color": "0.0, 0.0, 0.25" } } +] diff --git a/testing/configs/exodus.json b/testing/configs/exodus.json index 375b1c7498..82ed36c070 100644 --- a/testing/configs/exodus.json +++ b/testing/configs/exodus.json @@ -1,6 +1,9 @@ +[ { - ".*(ex2)": + "match": ".*(ex2)", + "options": { "load-plugins": "exodus" } } +] diff --git a/testing/configs/hdri.json.in b/testing/configs/hdri.json.in index d18f345016..6b58a62c4c 100644 --- a/testing/configs/hdri.json.in +++ b/testing/configs/hdri.json.in @@ -1,8 +1,10 @@ +[ { - ".*": + "options": { "hdri-ambient": true, "hdri-skybox": true, "hdri-file": "${F3D_SOURCE_DIR}/testing/data/palermo_park_1k.hdr" } } +] diff --git a/testing/configs/inexistent_key.json b/testing/configs/inexistent_key.json index 01d980cb1c..54e614b03d 100644 --- a/testing/configs/inexistent_key.json +++ b/testing/configs/inexistent_key.json @@ -1,6 +1,8 @@ +[ { - ".*": - { - "scene.animation.inexistent": 0 - } + "options": + { + "scene.animation.inexistent": 0 + } } +] diff --git a/testing/configs/invalid_options.json b/testing/configs/invalid_options.json new file mode 100644 index 0000000000..803b2d6287 --- /dev/null +++ b/testing/configs/invalid_options.json @@ -0,0 +1,3 @@ +[ + "options" +] diff --git a/testing/configs/invalid_value.json b/testing/configs/invalid_value.json index 9907c46c22..723c8c7d59 100644 --- a/testing/configs/invalid_value.json +++ b/testing/configs/invalid_value.json @@ -1,6 +1,8 @@ +[ { - ".*": - { - "verbose": {"foo": "bar"} - } + "options": + { + "verbose": {"foo": "bar"} + } } +] diff --git a/testing/configs/no_options.json b/testing/configs/no_options.json new file mode 100644 index 0000000000..8592edf040 --- /dev/null +++ b/testing/configs/no_options.json @@ -0,0 +1,8 @@ +[ +{ + "opsions": + { + "verbose": true + } +} +] diff --git a/testing/configs/nonparsable_value.json b/testing/configs/nonparsable_value.json index 5ba5f091b3..f91142145d 100644 --- a/testing/configs/nonparsable_value.json +++ b/testing/configs/nonparsable_value.json @@ -1,6 +1,8 @@ +[ { - ".*": - { - "scene.animation.index": "nonparsable" - } + "options": + { + "scene.animation.index": "nonparsable" + } } +] diff --git a/testing/configs/quiet.json b/testing/configs/quiet.json index 7789d4fe73..b8dadf6c7a 100644 --- a/testing/configs/quiet.json +++ b/testing/configs/quiet.json @@ -1,7 +1,9 @@ +[ { - ".*": + "options": { "verbose": "quiet", "no-render": true } } +] diff --git a/testing/configs/resolution.json b/testing/configs/resolution.json index 86d68ed620..b70322bb2e 100644 --- a/testing/configs/resolution.json +++ b/testing/configs/resolution.json @@ -1,10 +1,15 @@ +[ { - ".*": + "options": { "resolution": "400,400" - }, - ".*(stl)": + } +}, +{ + "match": ".*(stl)", + "options": { "resolution": "200,200" } } +] diff --git a/testing/configs/verbose.json b/testing/configs/verbose.json index 973473df82..026856c192 100644 --- a/testing/configs/verbose.json +++ b/testing/configs/verbose.json @@ -1,6 +1,8 @@ +[ { - ".*": + "options": { "verbose": true } } +]