fix failing C++ tests that depend on test data - closes #2787
This commit is contained in:
parent
a608269946
commit
ad2e8afb55
6 changed files with 24 additions and 19 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "test/data"]
|
||||
path = test/data
|
||||
url = git@github.com:mapnik/test-data
|
|
@ -29,6 +29,7 @@ NOTE: the above will not work on windows, rather see https://github.com/mapnik/m
|
|||
|
||||
Then to run the tests locally (without needing to install):
|
||||
|
||||
git submodule update --init
|
||||
make test
|
||||
|
||||
Install like:
|
||||
|
|
1
test/data
Submodule
1
test/data
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 9f7c39f85fceb4aa20c07a66f9848d10bf1451db
|
|
@ -9,7 +9,7 @@
|
|||
TEST_CASE("geometry") {
|
||||
|
||||
SECTION("json point") {
|
||||
mapnik::util::file input("./test-data/json/point1.json");
|
||||
mapnik::util::file input("./test/data/json/point1.json");
|
||||
REQUIRE( input.open() );
|
||||
auto json = input.data();
|
||||
mapnik::geometry::geometry<double> geom;
|
||||
|
@ -24,7 +24,7 @@ SECTION("json point") {
|
|||
}
|
||||
|
||||
SECTION("json point reversed") {
|
||||
mapnik::util::file input("./test-data/json/point2.json");
|
||||
mapnik::util::file input("./test/data/json/point2.json");
|
||||
REQUIRE( input.open() );
|
||||
auto json = input.data();
|
||||
mapnik::geometry::geometry<double> geom;
|
||||
|
|
|
@ -21,7 +21,7 @@ SECTION("readers") {
|
|||
try
|
||||
{
|
||||
#if defined(HAVE_JPEG)
|
||||
should_throw = "./test-data/images/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-data/images/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 = "./test-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-data/images/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-data/images/blank.webp";
|
||||
should_throw = "./test/data/images/blank.webp";
|
||||
REQUIRE( mapnik::util::exists( should_throw ) );
|
||||
type = mapnik::type_from_filename(should_throw);
|
||||
REQUIRE( type );
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
TEST_CASE("tiff io") {
|
||||
|
||||
SECTION("scan rgb8 striped") {
|
||||
std::string filename("./test-data/tiff/scan_512x512_rgb8_striped.tif");
|
||||
std::string filename("./test/data/tiff/scan_512x512_rgb8_striped.tif");
|
||||
mapnik::tiff_reader<boost::iostreams::file_source> 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("./test-data/tiff/scan_512x512_rgb8_tiled.tif");
|
||||
std::string filename("./test/data/tiff/scan_512x512_rgb8_tiled.tif");
|
||||
mapnik::tiff_reader<boost::iostreams::file_source> 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("./test-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("./test-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("./test-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("./test-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("./test-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("./test-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("./test-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("./test-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("./test-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("./test-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 );
|
||||
|
|
Loading…
Reference in a new issue