write images to custom tmp directory and create it first
This commit is contained in:
parent
cd9b214d55
commit
b14d525968
1 changed files with 11 additions and 1 deletions
|
@ -14,7 +14,15 @@
|
|||
#include <mapnik/cairo/cairo_image_util.hpp>
|
||||
#endif
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#include <mapnik/warning_ignore.hpp>
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#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;
|
||||
|
|
Loading…
Reference in a new issue