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