diff --git a/test/unit/imaging/image_io_test.cpp b/test/unit/imaging/image_io_test.cpp index 7591d487a..eccd8577b 100644 --- a/test/unit/imaging/image_io_test.cpp +++ b/test/unit/imaging/image_io_test.cpp @@ -14,7 +14,15 @@ #include #endif +#pragma GCC diagnostic push +#include #include +#include +#pragma GCC diagnostic pop + +inline bool make_directory(std::string const& dir) { + return boost::filesystem::create_directory(dir); +} TEST_CASE("image io") { @@ -144,12 +152,14 @@ SECTION("image_util : save_to_file/save_to_stream/save_to_string") supported_types.push_back(std::make_tuple("webp","webp")); #endif + REQUIRE(make_directory("/tmp/mapnik-tests/")); + for (auto const& info : supported_types) { std::string extension; std::string format; std::tie(extension, format) = info; - std::string filename = (boost::format("/tmp/mapnik-%1%.%2%") % named_color % extension).str(); + std::string filename = (boost::format("/tmp/mapnik-tests/mapnik-%1%.%2%") % named_color % extension).str(); mapnik::save_to_file(im, filename); std::string str = mapnik::save_to_string(im, format); std::ostringstream ss;