From 01d3c91de4e0fc727562c6650fce5cbf83f4194f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 7 Oct 2015 14:41:07 -0700 Subject: [PATCH] only run test if plugins exist --- .../datasource_registration_test.cpp | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/test/standalone/datasource_registration_test.cpp b/test/standalone/datasource_registration_test.cpp index 2edbcd72f..9d6266c47 100644 --- a/test/standalone/datasource_registration_test.cpp +++ b/test/standalone/datasource_registration_test.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -22,19 +23,24 @@ SECTION("registration") { success = cache.register_datasources("test/data/vrt"); CHECK(success == false); - // registering a directory for the first time should return true - success = cache.register_datasources("plugins/input"); - REQUIRE(success == true); + // use existence of shape.input as proxy for whether any datasource plugins are available + std::string shape_plugin("./plugins/input/shape.input"); + if (mapnik::util::exists(shape_plugin)) + { + // registering a directory for the first time should return true + success = cache.register_datasources("plugins/input"); + REQUIRE(success == true); - // registering the same directory again should now return false - success = cache.register_datasources("plugins/input"); - CHECK(success == false); + // registering the same directory again should now return false + success = cache.register_datasources("plugins/input"); + CHECK(success == false); - // registering the same directory again, but recursively should - // still return false - even though there are subdirectories, they - // do not contain any more plugins. - success = cache.register_datasources("plugins/input", true); - CHECK(success == false); + // registering the same directory again, but recursively should + // still return false - even though there are subdirectories, they + // do not contain any more plugins. + success = cache.register_datasources("plugins/input", true); + CHECK(success == false); + } } catch (std::exception const & ex) {