diff --git a/src/Magnum/SceneTools/Test/CMakeLists.txt b/src/Magnum/SceneTools/Test/CMakeLists.txt index a9f30d050..f6fbce27f 100644 --- a/src/Magnum/SceneTools/Test/CMakeLists.txt +++ b/src/Magnum/SceneTools/Test/CMakeLists.txt @@ -75,6 +75,8 @@ corrade_add_test(SceneToolsSceneConverterTest SceneConverterTest.cpp SceneConverterTestFiles/images-3d.gltf SceneConverterTestFiles/images-3d-1x1x1.bin SceneConverterTestFiles/images-3d-1x1x1.gltf + SceneConverterTestFiles/info-data.txt + SceneConverterTestFiles/info-data-ignored-output.txt SceneConverterTestFiles/info-animations.txt SceneConverterTestFiles/info-cameras.txt SceneConverterTestFiles/info-images.txt diff --git a/src/Magnum/SceneTools/Test/SceneConverterTest.cpp b/src/Magnum/SceneTools/Test/SceneConverterTest.cpp index 16d9e5f25..9613406ec 100644 --- a/src/Magnum/SceneTools/Test/SceneConverterTest.cpp +++ b/src/Magnum/SceneTools/Test/SceneConverterTest.cpp @@ -99,18 +99,23 @@ const struct { const struct { const char* name; Containers::Array args; + const char* requiresImporter; const char* expected; } InfoData[]{ - {"", Containers::array({}), - "info.txt"}, - {"map", Containers::array({ - "--map"}), + {"data", Containers::array({ + "-I", "ObjImporter", "--info", Utility::Path::join(SCENETOOLS_TEST_DIR, "SceneConverterTestFiles/point.obj")}), + "ObjImporter", + "info-data.txt"}, + {"data, map", Containers::array({ + "--map", "-I", "ObjImporter", "--info", Utility::Path::join(SCENETOOLS_TEST_DIR, "SceneConverterTestFiles/point.obj")}), + "ObjImporter", /** @todo change to something else once we have a plugin that can zero-copy pass the imported data */ - "info.txt"}, - {"ignored output file", Containers::array({ - "whatever.ply"}), - "info-ignored-output.txt"}, + "info-data.txt"}, + {"data, ignored output file", Containers::array({ + "-I", "ObjImporter", "--info", Utility::Path::join(SCENETOOLS_TEST_DIR, "SceneConverterTestFiles/point.obj"), "whatever.ply"}), + "ObjImporter", + "info-data-ignored-output.txt"} }; const struct { @@ -1968,16 +1973,12 @@ void SceneConverterTest::info() { /* Check if required plugins can be loaded. Catches also ABI and interface mismatch errors. */ PluginManager::Manager importerManager{MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR}; - if(!(importerManager.load("ObjImporter") & PluginManager::LoadState::Loaded)) - CORRADE_SKIP("ObjImporter plugin can't be loaded."); - - Containers::Array args{InPlaceInit, - {"-I", "ObjImporter", "--info", Utility::Path::join(SCENETOOLS_TEST_DIR, "SceneConverterTestFiles/point.obj")}}; - arrayAppend(args, data.args); + if(data.requiresImporter && !(importerManager.load(data.requiresImporter) & PluginManager::LoadState::Loaded)) + CORRADE_SKIP(data.requiresImporter << "plugin can't be loaded."); CORRADE_VERIFY(true); /* capture correct function name */ - Containers::Pair output = call(args); + Containers::Pair output = call(data.args); CORRADE_COMPARE_AS(output.second(), Utility::Path::join({SCENETOOLS_TEST_DIR, "SceneConverterTestFiles", data.expected}), TestSuite::Compare::StringToFile); diff --git a/src/Magnum/SceneTools/Test/SceneConverterTestFiles/info-ignored-output.txt b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/info-data-ignored-output.txt similarity index 100% rename from src/Magnum/SceneTools/Test/SceneConverterTestFiles/info-ignored-output.txt rename to src/Magnum/SceneTools/Test/SceneConverterTestFiles/info-data-ignored-output.txt diff --git a/src/Magnum/SceneTools/Test/SceneConverterTestFiles/info.txt b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/info-data.txt similarity index 100% rename from src/Magnum/SceneTools/Test/SceneConverterTestFiles/info.txt rename to src/Magnum/SceneTools/Test/SceneConverterTestFiles/info-data.txt