diff --git a/.travis.yml b/.travis.yml index 42f4718b7..da0e1a3da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ script: - source bootstrap.sh - if [[ ${COVERAGE} == true ]]; then ./configure CUSTOM_LDFLAGS='--coverage' CUSTOM_CXXFLAGS='--coverage' CUSTOM_CFLAGS='--coverage' DEBUG=True; else ./configure; fi; - make + - git clone --depth=1 https://github.com/mapnik/test-data test-data - git clone --depth=1 https://github.com/mapbox/mapnik-test-data tests/data/mapnik-test-data - make test - if [[ ${COVERAGE} == true ]]; then diff --git a/test/standalone/font_registration_test.cpp b/test/standalone/font_registration_test.cpp index a876c6a17..4e1ba0330 100644 --- a/test/standalone/font_registration_test.cpp +++ b/test/standalone/font_registration_test.cpp @@ -86,12 +86,12 @@ SECTION("registration") { REQUIRE( mapnik::freetype_engine::face_names().size() == 0 ); // bogus, emtpy file that looks like font - REQUIRE( mapnik::freetype_engine::register_font("tests/data/fonts/fake.ttf") == false ); - REQUIRE( mapnik::freetype_engine::register_fonts("tests/data/fonts/fake.ttf") == false ); + REQUIRE( mapnik::freetype_engine::register_font("test-data/fonts/fake.ttf") == false ); + REQUIRE( mapnik::freetype_engine::register_fonts("test-data/fonts/fake.ttf") == false ); REQUIRE( mapnik::freetype_engine::face_names().size() == 0 ); - REQUIRE( mapnik::freetype_engine::register_font("tests/data/fonts/intentionally-broken.ttf") == false ); - REQUIRE( mapnik::freetype_engine::register_fonts("tests/data/fonts/intentionally-broken.ttf") == false ); + REQUIRE( mapnik::freetype_engine::register_font("test-data/fonts/intentionally-broken.ttf") == false ); + REQUIRE( mapnik::freetype_engine::register_fonts("test-data/fonts/intentionally-broken.ttf") == false ); REQUIRE( mapnik::freetype_engine::face_names().size() == 0 ); // now restore the original severity @@ -109,7 +109,7 @@ SECTION("registration") { REQUIRE( face_names.size() == 1 ); // single dejavu font in separate location - std::string dejavu_bold_oblique("tests/data/fonts/DejaVuSansMono-BoldOblique.ttf"); + std::string dejavu_bold_oblique("test-data/fonts/DejaVuSansMono-BoldOblique.ttf"); REQUIRE( mapnik::freetype_engine::register_font(dejavu_bold_oblique) ); face_names = mapnik::freetype_engine::face_names(); REQUIRE( face_names.size() == 2 ); @@ -164,7 +164,7 @@ SECTION("registration") { // check that we can correctly read a .ttc containing // multiple valid faces // https://github.com/mapnik/mapnik/issues/2274 - REQUIRE( mapnik::freetype_engine::register_font("tests/data/fonts/NotoSans-Regular.ttc") ); + REQUIRE( mapnik::freetype_engine::register_font("test-data/fonts/NotoSans-Regular.ttc") ); face_names = mapnik::freetype_engine::face_names(); REQUIRE( face_names.size() == 24 ); diff --git a/test/unit/data/blank.jpg b/test/unit/data/blank.jpg deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/unit/data/blank.png b/test/unit/data/blank.png deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/unit/data/blank.tiff b/test/unit/data/blank.tiff deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/unit/data/blank.webp b/test/unit/data/blank.webp deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/unit/geometry/geometry.cpp b/test/unit/geometry/geometry.cpp index fd17eabef..af004d5d6 100644 --- a/test/unit/geometry/geometry.cpp +++ b/test/unit/geometry/geometry.cpp @@ -9,7 +9,8 @@ TEST_CASE("geometry") { SECTION("json point") { - mapnik::util::file input("./tests/data/json/fixtures/point1.json"); + mapnik::util::file input("./test-data/json/point1.json"); + REQUIRE( input.open() ); auto json = input.data(); mapnik::geometry::geometry geom; std::string json_string(json.get()); @@ -23,7 +24,8 @@ SECTION("json point") { } SECTION("json point reversed") { - mapnik::util::file input("./tests/data/json/fixtures/point2.json"); + mapnik::util::file input("./test-data/json/point2.json"); + REQUIRE( input.open() ); auto json = input.data(); mapnik::geometry::geometry geom; std::string json_string(json.get()); diff --git a/test/unit/imaging/image_io_test.cpp b/test/unit/imaging/image_io_test.cpp index 52ac7d633..b263cdacd 100644 --- a/test/unit/imaging/image_io_test.cpp +++ b/test/unit/imaging/image_io_test.cpp @@ -21,7 +21,7 @@ SECTION("readers") { try { #if defined(HAVE_JPEG) - should_throw = "./test/unit/data/blank.jpg"; + should_throw = "./test-data/images/blank.jpg"; REQUIRE( mapnik::util::exists( should_throw ) ); type = mapnik::type_from_filename(should_throw); REQUIRE( type ); @@ -59,7 +59,7 @@ SECTION("readers") { #endif #if defined(HAVE_PNG) - should_throw = "./test/unit/data/blank.png"; + should_throw = "./test-data/images/blank.png"; REQUIRE( mapnik::util::exists( should_throw ) ); type = mapnik::type_from_filename(should_throw); REQUIRE( type ); @@ -73,7 +73,7 @@ SECTION("readers") { REQUIRE( true ); } - should_throw = "./tests/data/images/xcode-CgBI.png"; + should_throw = "./test-data/images/xcode-CgBI.png"; REQUIRE( mapnik::util::exists( should_throw ) ); type = mapnik::type_from_filename(should_throw); REQUIRE( type ); @@ -89,7 +89,7 @@ SECTION("readers") { #endif #if defined(HAVE_TIFF) - should_throw = "./test/unit/data/blank.tiff"; + should_throw = "./test-data/images/blank.tiff"; REQUIRE( mapnik::util::exists( should_throw ) ); type = mapnik::type_from_filename(should_throw); REQUIRE( type ); @@ -105,7 +105,7 @@ SECTION("readers") { #endif #if defined(HAVE_WEBP) - should_throw = "./test/unit/data/blank.webp"; + should_throw = "./test-data/images/blank.webp"; REQUIRE( mapnik::util::exists( should_throw ) ); type = mapnik::type_from_filename(should_throw); REQUIRE( type ); diff --git a/test/unit/imaging/tiff_io.cpp b/test/unit/imaging/tiff_io.cpp index 46cf4245f..8fc603b46 100644 --- a/test/unit/imaging/tiff_io.cpp +++ b/test/unit/imaging/tiff_io.cpp @@ -59,7 +59,7 @@ TEST_CASE("tiff io") { SECTION("scan rgb8 striped") { - std::string filename("./tests/data/tiff/scan_512x512_rgb8_striped.tif"); + std::string filename("./test-data/tiff/scan_512x512_rgb8_striped.tif"); mapnik::tiff_reader tiff_reader(filename); REQUIRE( tiff_reader.width() == 512 ); REQUIRE( tiff_reader.height() == 512 ); @@ -89,7 +89,7 @@ SECTION("scan rgb8 striped") { } SECTION("scan rgb8 tiled") { - std::string filename("./tests/data/tiff/scan_512x512_rgb8_tiled.tif"); + std::string filename("./test-data/tiff/scan_512x512_rgb8_tiled.tif"); mapnik::tiff_reader tiff_reader(filename); REQUIRE( tiff_reader.width() == 512 ); REQUIRE( tiff_reader.height() == 512 ); @@ -119,7 +119,7 @@ SECTION("scan rgb8 tiled") { } SECTION("rgba8 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgba8_striped.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_rgba8_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 1 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -135,7 +135,7 @@ SECTION("rgba8 striped") { } SECTION("rgba8 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgba8_tiled.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_rgba8_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -151,7 +151,7 @@ SECTION("rgba8 tiled") { } SECTION("rgb8 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgb8_striped.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_rgb8_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 10 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -167,7 +167,7 @@ SECTION("rgb8 striped") { } SECTION("rgb8 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgb8_tiled.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_rgb8_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -183,7 +183,7 @@ SECTION("rgb8 tiled") { } SECTION("gray8 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray8_striped.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_gray8_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 32 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -199,7 +199,7 @@ SECTION("gray8 striped") { } SECTION("gray8 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray8_tiled.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_gray8_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -215,7 +215,7 @@ SECTION("gray8 tiled") { } SECTION("gray16 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray16_striped.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_gray16_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 16 ); REQUIRE( tiff_reader.bits_per_sample() == 16 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -231,7 +231,7 @@ SECTION("gray16 striped") { } SECTION("gray16 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray16_tiled.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_gray16_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 16 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -247,7 +247,7 @@ SECTION("gray16 tiled") { } SECTION("gray32f striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray32f_striped.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_gray32f_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 8 ); REQUIRE( tiff_reader.bits_per_sample() == 32 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -263,7 +263,7 @@ SECTION("gray32f striped") { } SECTION("gray32f tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray32f_tiled.tif") + TIFF_ASSERT("./test-data/tiff/ndvi_256x256_gray32f_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 32 ); REQUIRE( tiff_reader.is_tiled() == true );