ensure tests pass with no plugins built
This commit is contained in:
parent
a4753f4c87
commit
1eea7294ae
3 changed files with 550 additions and 534 deletions
|
@ -10,7 +10,7 @@
|
|||
#include <mapnik/expression.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
|
||||
#include <mapnik/util/fs.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/range/iterator_range_core.hpp>
|
||||
#include <boost/format.hpp>
|
||||
|
@ -157,9 +157,14 @@ void require_geometry(mapnik::feature_ptr feature,
|
|||
}
|
||||
} // anonymous namespace
|
||||
|
||||
const bool registered = mapnik::datasource_cache::instance().register_datasources("./plugins/input/");
|
||||
|
||||
TEST_CASE("csv") {
|
||||
|
||||
std::string csv_plugin("./plugins/input/csv.input");
|
||||
if (mapnik::util::exists(csv_plugin))
|
||||
{
|
||||
|
||||
const bool registered = mapnik::datasource_cache::instance().register_datasources(csv_plugin);
|
||||
|
||||
REQUIRE(registered);
|
||||
|
||||
// make the tests silent since we intentially test error conditions that are noisy
|
||||
|
@ -601,8 +606,8 @@ TEST_CASE("csv") {
|
|||
}
|
||||
} // END SECTION
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||
SECTION("64bit int fields work") {
|
||||
auto ds = get_csv_ds("test/data/csv/64bit_int.csv");
|
||||
auto fields = ds->get_descriptor().get_descriptors();
|
||||
|
@ -620,7 +625,7 @@ TEST_CASE("csv") {
|
|||
require_attributes(feature, {
|
||||
attr{"x", 0}, attr{"y", 0}, attr{"bigint", 0x7FFFFFFFFFFFFFFFll} });
|
||||
} // END SECTION
|
||||
#pragma GCC diagnostic pop
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
SECTION("various number types") {
|
||||
auto ds = get_csv_ds("test/data/csv/number_types.csv");
|
||||
|
@ -672,4 +677,5 @@ TEST_CASE("csv") {
|
|||
} // END SECTION
|
||||
|
||||
mapnik::logger::instance().set_severity(severity);
|
||||
}
|
||||
} // END TEST CASE
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <mapnik/color.hpp>
|
||||
#include <mapnik/datasource.hpp>
|
||||
#include <mapnik/datasource_cache.hpp>
|
||||
#include <mapnik/util/fs.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
@ -19,6 +20,9 @@ SECTION("layers") {
|
|||
{
|
||||
mapnik::Map m0(100,100);
|
||||
mapnik::Map m2(200,100);
|
||||
std::string shape_plugin("./plugins/input/shape.input");
|
||||
if (mapnik::util::exists(shape_plugin))
|
||||
{
|
||||
mapnik::datasource_cache::instance().register_datasources("plugins/input/shape.input");
|
||||
mapnik::parameters p;
|
||||
p["type"]="shape";
|
||||
|
@ -69,6 +73,7 @@ SECTION("layers") {
|
|||
|
||||
REQUIRE( (m0 == m2) );
|
||||
}
|
||||
}
|
||||
catch (std::exception const & ex)
|
||||
{
|
||||
std::clog << ex.what() << "\n";
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <mapnik/datasource_cache.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/expression.hpp>
|
||||
#include <mapnik/util/fs.hpp>
|
||||
|
||||
TEST_CASE("image") {
|
||||
|
||||
|
@ -17,7 +18,10 @@ SECTION("painting") {
|
|||
|
||||
try
|
||||
{
|
||||
datasource_cache::instance().register_datasources("plugins/input/csv.input");
|
||||
std::string csv_plugin("./plugins/input/csv.input");
|
||||
if (mapnik::util::exists(csv_plugin))
|
||||
{
|
||||
datasource_cache::instance().register_datasources(csv_plugin);
|
||||
|
||||
Map m(256, 256);
|
||||
|
||||
|
@ -59,6 +63,7 @@ SECTION("painting") {
|
|||
|
||||
REQUIRE(image.painted() == true);
|
||||
}
|
||||
}
|
||||
catch (std::exception const & ex)
|
||||
{
|
||||
std::clog << ex.what() << std::endl;
|
||||
|
|
Loading…
Add table
Reference in a new issue