visual tests: drop config.cpp

This commit is contained in:
Jiri Drbalek 2015-05-19 17:11:44 +00:00
parent 3db7b0ca9b
commit 8519bde143
6 changed files with 3 additions and 48 deletions

View file

@ -45,7 +45,6 @@ else:
# visual tests
source = Split(
"""
visual/config.cpp
visual/report.cpp
visual/runner.cpp
visual/run.cpp

View file

@ -1,40 +0,0 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2015 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
// mapnik
#include <mapnik/util/fs.hpp>
#include "config.hpp"
namespace visual_tests
{
bool ensure_dir(boost::filesystem::path const & dir)
{
if (!mapnik::util::exists(dir.string()))
{
return boost::filesystem::create_directories(dir);
}
return true;
}
}

View file

@ -75,8 +75,6 @@ struct result
using result_list = std::vector<result>;
bool ensure_dir(boost::filesystem::path const & dir);
}
#endif

View file

@ -31,7 +31,6 @@
// mapnik
#include <mapnik/map.hpp>
#include <mapnik/util/fs.hpp>
#include <mapnik/agg_renderer.hpp>
#if defined(HAVE_CAIRO)
#include <mapnik/cairo/cairo_renderer.hpp>
@ -118,7 +117,7 @@ public:
{
typename Renderer::image_type image(ren.render(map, scale_factor));
boost::filesystem::path reference = reference_dir / image_file_name(name, map.width(), map.height(), scale_factor, true);
bool reference_exists = mapnik::util::exists(reference.string());
bool reference_exists = boost::filesystem::exists(reference);
result res;
res.state = reference_exists ? STATE_OK : STATE_OVERWRITE;
@ -131,7 +130,7 @@ public:
if (res.diff)
{
ensure_dir(output_dir);
boost::filesystem::create_directories(output_dir);
boost::filesystem::path path = output_dir / image_file_name(name, map.width(), map.height(), scale_factor);
res.actual_image_path = path;
res.state = STATE_FAIL;

View file

@ -189,7 +189,7 @@ void html_report::summary(result_list const & results, boost::filesystem::path c
void html_summary(result_list const & results, boost::filesystem::path output_dir)
{
boost::filesystem::path html_root = output_dir / "visual-test-results";
ensure_dir(html_root);
boost::filesystem::create_directories(html_root);
boost::filesystem::path html_report_path = html_root / "index.html";
std::clog << "View failure report at " << html_report_path << "\n";
std::ofstream output_file(html_report_path.string());

View file

@ -25,7 +25,6 @@
#include <future>
#include <mapnik/load_map.hpp>
#include <mapnik/util/fs.hpp>
#include "runner.hpp"