diff --git a/test/unit/color/css_color.cpp b/test/unit/color/css_color.cpp index 54c90e71b..f1bc17196 100644 --- a/test/unit/color/css_color.cpp +++ b/test/unit/color/css_color.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include #include diff --git a/test/unit/core/box2d_test.cpp b/test/unit/core/box2d_test.cpp index 14cbb48f6..8385bba7c 100644 --- a/test/unit/core/box2d_test.cpp +++ b/test/unit/core/box2d_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/core/comparison_test.cpp b/test/unit/core/comparison_test.cpp index 41b524c7a..7e8e8e414 100644 --- a/test/unit/core/comparison_test.cpp +++ b/test/unit/core/comparison_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/core/conversions_test.cpp b/test/unit/core/conversions_test.cpp index ba0c22371..43592af01 100644 --- a/test/unit/core/conversions_test.cpp +++ b/test/unit/core/conversions_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/core/exceptions_test.cpp b/test/unit/core/exceptions_test.cpp index 46abcce55..16ed51974 100644 --- a/test/unit/core/exceptions_test.cpp +++ b/test/unit/core/exceptions_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/core/expressions_test.cpp b/test/unit/core/expressions_test.cpp index 72490a215..1b7d12faf 100644 --- a/test/unit/core/expressions_test.cpp +++ b/test/unit/core/expressions_test.cpp @@ -1,3 +1,4 @@ + #include "catch_ext.hpp" #include diff --git a/test/unit/core/params_test.cpp b/test/unit/core/params_test.cpp index 677de7ad0..3131f0cbc 100644 --- a/test/unit/core/params_test.cpp +++ b/test/unit/core/params_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/core/value_test.cpp b/test/unit/core/value_test.cpp index 048015460..cdb64dbbe 100644 --- a/test/unit/core/value_test.cpp +++ b/test/unit/core/value_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/datasource/csv.cpp b/test/unit/datasource/csv.cpp index 3f466ff6a..f0df3b2d4 100644 --- a/test/unit/datasource/csv.cpp +++ b/test/unit/datasource/csv.cpp @@ -79,31 +79,11 @@ mapnik::datasource_ptr get_csv_ds(std::string const& file_name, bool strict = tr return ds; } -int create_disk_index(std::string const& filename, bool silent = true) -{ - std::string cmd; - if (std::getenv("DYLD_LIBRARY_PATH") != nullptr) - { - cmd += std::string("DYLD_LIBRARY_PATH=") + std::getenv("DYLD_LIBRARY_PATH") + " "; - } - cmd += "mapnik-index " + filename; - if (silent) - { -#ifndef _WINDOWS - cmd += " 2>/dev/null"; -#else - cmd += " 2> nul"; -#endif - } - return std::system(cmd.c_str()); -} - } // anonymous namespace -static const std::string csv_plugin("./plugins/input/csv.input"); - TEST_CASE("csv") { + std::string csv_plugin("./plugins/input/csv.input"); if (mapnik::util::exists(csv_plugin)) { // make the tests silent since we intentionally test error conditions that are noisy diff --git a/test/unit/datasource/ds_test_util.hpp b/test/unit/datasource/ds_test_util.hpp index bfa5b1757..6e1c222b4 100644 --- a/test/unit/datasource/ds_test_util.hpp +++ b/test/unit/datasource/ds_test_util.hpp @@ -20,6 +20,10 @@ * *****************************************************************************/ + +#ifndef MAPNIK_UNIT_DATSOURCE_UTIL +#define MAPNIK_UNIT_DATSOURCE_UTIL + #include "catch.hpp" #include @@ -176,4 +180,25 @@ inline void require_geometry(mapnik::feature_ptr feature, CHECK(feature_count(feature->get_geometry()) == num_parts); } +inline int create_disk_index(std::string const& filename, bool silent = true) +{ + std::string cmd; + if (std::getenv("DYLD_LIBRARY_PATH") != nullptr) + { + cmd += std::string("DYLD_LIBRARY_PATH=") + std::getenv("DYLD_LIBRARY_PATH") + " "; + } + cmd += "mapnik-index " + filename; + if (silent) + { +#ifndef _WINDOWS + cmd += " 2>/dev/null"; +#else + cmd += " 2> nul"; +#endif + } + return std::system(cmd.c_str()); } + +} + +#endif // MAPNIK_UNIT_DATSOURCE_UTIL diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp index e8c0a90a3..0b0f2052a 100644 --- a/test/unit/datasource/geojson.cpp +++ b/test/unit/datasource/geojson.cpp @@ -62,25 +62,6 @@ std::pair fetch_first_feature(std::s return std::make_pair(ds,feature); } -int create_disk_index(std::string const& filename, bool silent = true) -{ - std::string cmd; - if (std::getenv("DYLD_LIBRARY_PATH") != nullptr) - { - cmd += std::string("DYLD_LIBRARY_PATH=") + std::getenv("DYLD_LIBRARY_PATH") + " "; - } - cmd += "mapnik-index " + filename; - if (silent) - { -#ifndef _WINDOWS - cmd += " 2>/dev/null"; -#else - cmd += " 2> nul"; -#endif - } - return std::system(cmd.c_str()); -} - } TEST_CASE("geojson") { diff --git a/test/unit/font/fontset_runtime_test.cpp b/test/unit/font/fontset_runtime_test.cpp index e5a621190..bfbae2786 100644 --- a/test/unit/font/fontset_runtime_test.cpp +++ b/test/unit/font/fontset_runtime_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/centroid.cpp b/test/unit/geometry/centroid.cpp index 1e58aad4e..cdfbd6e4b 100644 --- a/test/unit/geometry/centroid.cpp +++ b/test/unit/geometry/centroid.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/geometry.cpp b/test/unit/geometry/geometry.cpp index 556f6cacf..60f9c0b95 100644 --- a/test/unit/geometry/geometry.cpp +++ b/test/unit/geometry/geometry.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/geometry_envelope_test.cpp b/test/unit/geometry/geometry_envelope_test.cpp index d23c9760c..fd5d78fbd 100644 --- a/test/unit/geometry/geometry_envelope_test.cpp +++ b/test/unit/geometry/geometry_envelope_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/geometry_equal.hpp b/test/unit/geometry/geometry_equal.hpp index 3907149ac..f8ebc4d25 100644 --- a/test/unit/geometry/geometry_equal.hpp +++ b/test/unit/geometry/geometry_equal.hpp @@ -1,3 +1,7 @@ + +#ifndef MAPNIK_UNIT_GEOMETRY_EQUAL +#define MAPNIK_UNIT_GEOMETRY_EQUAL + #include "catch.hpp" // boost @@ -214,3 +218,5 @@ void assert_g_equal(T const& g1, T const& g2) { return geometry_equal_visitor()(g1,g2); } + +#endif // MAPNIK_UNIT_GEOMETRY_EQUAL diff --git a/test/unit/geometry/geometry_hit_test.cpp b/test/unit/geometry/geometry_hit_test.cpp index 7552d0143..3b21407f6 100644 --- a/test/unit/geometry/geometry_hit_test.cpp +++ b/test/unit/geometry/geometry_hit_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/geometry_is_simple.cpp b/test/unit/geometry/geometry_is_simple.cpp index 1170350b9..55480585c 100644 --- a/test/unit/geometry/geometry_is_simple.cpp +++ b/test/unit/geometry/geometry_is_simple.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/geometry_is_valid.cpp b/test/unit/geometry/geometry_is_valid.cpp index c36549b3e..de1ee4c04 100644 --- a/test/unit/geometry/geometry_is_valid.cpp +++ b/test/unit/geometry/geometry_is_valid.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/geometry_reprojection.cpp b/test/unit/geometry/geometry_reprojection.cpp index dad9e294e..c8ec36243 100644 --- a/test/unit/geometry/geometry_reprojection.cpp +++ b/test/unit/geometry/geometry_reprojection.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include "geometry_equal.hpp" diff --git a/test/unit/geometry/geometry_strategy_test.cpp b/test/unit/geometry/geometry_strategy_test.cpp index 50acb721d..c08e828cb 100644 --- a/test/unit/geometry/geometry_strategy_test.cpp +++ b/test/unit/geometry/geometry_strategy_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include "geometry_equal.hpp" diff --git a/test/unit/geometry/has_empty.cpp b/test/unit/geometry/has_empty.cpp index a240c6f9b..b7fcab14e 100644 --- a/test/unit/geometry/has_empty.cpp +++ b/test/unit/geometry/has_empty.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/is_empty.cpp b/test/unit/geometry/is_empty.cpp index bb6a6349b..949b2b285 100644 --- a/test/unit/geometry/is_empty.cpp +++ b/test/unit/geometry/is_empty.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/geometry/remove_empty.cpp b/test/unit/geometry/remove_empty.cpp index 15237542f..93881c854 100644 --- a/test/unit/geometry/remove_empty.cpp +++ b/test/unit/geometry/remove_empty.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/imaging/image.cpp b/test/unit/imaging/image.cpp index 9800860b9..2024953eb 100644 --- a/test/unit/imaging/image.cpp +++ b/test/unit/imaging/image.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/imaging/image_apply_opacity.cpp b/test/unit/imaging/image_apply_opacity.cpp index 09f8dd1c3..512097c0d 100644 --- a/test/unit/imaging/image_apply_opacity.cpp +++ b/test/unit/imaging/image_apply_opacity.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/imaging/image_filter.cpp b/test/unit/imaging/image_filter.cpp index 2b43c4d2d..5329ea4bb 100644 --- a/test/unit/imaging/image_filter.cpp +++ b/test/unit/imaging/image_filter.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/imaging/image_io_test.cpp b/test/unit/imaging/image_io_test.cpp index f2463f810..7591d487a 100644 --- a/test/unit/imaging/image_io_test.cpp +++ b/test/unit/imaging/image_io_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/imaging/image_is_solid.cpp b/test/unit/imaging/image_is_solid.cpp index 5bc8217ba..ffc527e1a 100644 --- a/test/unit/imaging/image_is_solid.cpp +++ b/test/unit/imaging/image_is_solid.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/imaging/image_painted_test.cpp b/test/unit/imaging/image_painted_test.cpp index 5d0b403f7..3705f2e40 100644 --- a/test/unit/imaging/image_painted_test.cpp +++ b/test/unit/imaging/image_painted_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/imaging/image_premultiply.cpp b/test/unit/imaging/image_premultiply.cpp index 3a5e2a1c0..813d21c28 100644 --- a/test/unit/imaging/image_premultiply.cpp +++ b/test/unit/imaging/image_premultiply.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/imaging/image_set_pixel.cpp b/test/unit/imaging/image_set_pixel.cpp index 3488e0005..d23476535 100644 --- a/test/unit/imaging/image_set_pixel.cpp +++ b/test/unit/imaging/image_set_pixel.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/imaging/image_view.cpp b/test/unit/imaging/image_view.cpp index 25dbacfd9..db129d75c 100644 --- a/test/unit/imaging/image_view.cpp +++ b/test/unit/imaging/image_view.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/numerics/enumeration.cpp b/test/unit/numerics/enumeration.cpp index 3c15993e6..64a6afcc3 100644 --- a/test/unit/numerics/enumeration.cpp +++ b/test/unit/numerics/enumeration.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include #include diff --git a/test/unit/numerics/safe_cast.cpp b/test/unit/numerics/safe_cast.cpp index b6cba62c1..cb743dffd 100644 --- a/test/unit/numerics/safe_cast.cpp +++ b/test/unit/numerics/safe_cast.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/pixel/agg_blend_src_over_test.cpp b/test/unit/pixel/agg_blend_src_over_test.cpp index 60846f7a2..f457703d7 100644 --- a/test/unit/pixel/agg_blend_src_over_test.cpp +++ b/test/unit/pixel/agg_blend_src_over_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/pixel/palette.cpp b/test/unit/pixel/palette.cpp index c45d06815..a1e74d236 100644 --- a/test/unit/pixel/palette.cpp +++ b/test/unit/pixel/palette.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/projection/proj_transform.cpp b/test/unit/projection/proj_transform.cpp index d2a37893a..95c959587 100644 --- a/test/unit/projection/proj_transform.cpp +++ b/test/unit/projection/proj_transform.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/serialization/wkb_formats_test.cpp b/test/unit/serialization/wkb_formats_test.cpp index 1f3a82e2f..698645266 100644 --- a/test/unit/serialization/wkb_formats_test.cpp +++ b/test/unit/serialization/wkb_formats_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/serialization/xml_parser_trim.cpp b/test/unit/serialization/xml_parser_trim.cpp index afd282416..0a556e9ef 100644 --- a/test/unit/serialization/xml_parser_trim.cpp +++ b/test/unit/serialization/xml_parser_trim.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/svg/svg_parser_test.cpp b/test/unit/svg/svg_parser_test.cpp index 3fee6a452..0e383045e 100644 --- a/test/unit/svg/svg_parser_test.cpp +++ b/test/unit/svg/svg_parser_test.cpp @@ -317,7 +317,7 @@ TEST_CASE("SVG parser") { std::make_tuple(0, 10,2), std::make_tuple(0, 10,95)}; - REQUIRE(std::equal(expected.begin(),expected.end(), vec.begin(),detail::vertex_equal<3>())); + REQUIRE(std::equal(expected.begin(),expected.end(), vec.begin(),vertex_equal<3>())); } SECTION("SVG viewbox fallback") @@ -377,7 +377,7 @@ TEST_CASE("SVG parser") { std::make_tuple(0, 10,2), std::make_tuple(0, 10,95)}; - REQUIRE(std::equal(expected.begin(),expected.end(), vec.begin(),detail::vertex_equal<3>())); + REQUIRE(std::equal(expected.begin(),expected.end(), vec.begin(),vertex_equal<3>())); } SECTION("SVG beveled ") diff --git a/test/unit/svg/svg_path_parser_test.cpp b/test/unit/svg/svg_path_parser_test.cpp index db13d2b4c..21a094cd7 100644 --- a/test/unit/svg/svg_path_parser_test.cpp +++ b/test/unit/svg/svg_path_parser_test.cpp @@ -50,7 +50,7 @@ void test_path_parser(std::string const& str, Expected const& expected) vec.emplace_back(x, y, cmd); //std::cerr << "std::make_tuple(" << x << ", " << y << ", " << cmd << ")," << std::endl; } - REQUIRE(std::equal(expected.begin(),expected.end(), vec.begin(), detail::vertex_equal<3>())); + REQUIRE(std::equal(expected.begin(),expected.end(), vec.begin(), vertex_equal<3>())); } } // anonymous ns diff --git a/test/unit/svg/util.hpp b/test/unit/svg/util.hpp index f8d9b5ff2..bbfcc1112 100644 --- a/test/unit/svg/util.hpp +++ b/test/unit/svg/util.hpp @@ -25,7 +25,7 @@ #include -namespace detail { +namespace { template struct vertex_equal diff --git a/test/unit/symbolizer/symbolizer_test.cpp b/test/unit/symbolizer/symbolizer_test.cpp index 3af053251..1b7c26934 100644 --- a/test/unit/symbolizer/symbolizer_test.cpp +++ b/test/unit/symbolizer/symbolizer_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include diff --git a/test/unit/text/shaping.cpp b/test/unit/text/shaping.cpp index 2e2701b8f..d9da17efb 100644 --- a/test/unit/text/shaping.cpp +++ b/test/unit/text/shaping.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include #include diff --git a/test/unit/vertex_adapter/clipping_test.cpp b/test/unit/vertex_adapter/clipping_test.cpp index 29a3e425a..2239e264c 100644 --- a/test/unit/vertex_adapter/clipping_test.cpp +++ b/test/unit/vertex_adapter/clipping_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/vertex_adapter/line_offset_test.cpp b/test/unit/vertex_adapter/line_offset_test.cpp index eba472faa..dcb8dc68b 100644 --- a/test/unit/vertex_adapter/line_offset_test.cpp +++ b/test/unit/vertex_adapter/line_offset_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/vertex_adapter/offset_converter.cpp b/test/unit/vertex_adapter/offset_converter.cpp index 8c2780d5b..9255f7d97 100644 --- a/test/unit/vertex_adapter/offset_converter.cpp +++ b/test/unit/vertex_adapter/offset_converter.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" // mapnik diff --git a/test/unit/vertex_adapter/simplify_converters_test.cpp b/test/unit/vertex_adapter/simplify_converters_test.cpp index a86f8d5e3..b43bb9355 100644 --- a/test/unit/vertex_adapter/simplify_converters_test.cpp +++ b/test/unit/vertex_adapter/simplify_converters_test.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" //#include diff --git a/test/unit/vertex_adapter/vertex_adapter.cpp b/test/unit/vertex_adapter/vertex_adapter.cpp index 4505faa56..da3e815fa 100644 --- a/test/unit/vertex_adapter/vertex_adapter.cpp +++ b/test/unit/vertex_adapter/vertex_adapter.cpp @@ -1,3 +1,4 @@ + #include "catch.hpp" #include