only run test if plugins exist

This commit is contained in:
Dane Springmeyer 2015-10-07 14:41:07 -07:00
parent 20aaeac515
commit 01d3c91de4

View file

@ -3,6 +3,7 @@
#include <mapnik/datasource_cache.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/util/fs.hpp>
#include <iostream>
#include <vector>
@ -22,6 +23,10 @@ SECTION("registration") {
success = cache.register_datasources("test/data/vrt");
CHECK(success == false);
// 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);
@ -36,6 +41,7 @@ SECTION("registration") {
success = cache.register_datasources("plugins/input", true);
CHECK(success == false);
}
}
catch (std::exception const & ex)
{
std::clog << ex.what() << "\n";