Files
MapLibreParticleLab/render-test/runner.hpp
Mikhail Pozdnyakov b03982730e [test runner] Command line option for the tests expectations path
-e[expectationsPath], --expectationsPath=[expectationsPath]

Test expectations path.
2019-10-21 16:10:45 +03:00

34 lines
868 B
C++

#pragma once
#include <mbgl/gfx/headless_frontend.hpp>
#include <mbgl/map/map.hpp>
#include <memory>
struct TestMetadata;
class TestRunner {
public:
TestRunner() = default;
bool run(TestMetadata&);
void reset();
/// Returns path of the render tests root directory.
static const std::string& getBasePath();
private:
bool runOperations(const std::string& key, TestMetadata&);
bool checkQueryTestResults(mbgl::PremultipliedImage&& actualImage,
std::vector<mbgl::Feature>&& features,
TestMetadata&);
bool checkRenderTestResults(mbgl::PremultipliedImage&& image, TestMetadata&);
struct Impl {
Impl(const TestMetadata&);
mbgl::HeadlessFrontend frontend;
mbgl::Map map;
};
std::unordered_map<std::string, std::unique_ptr<Impl>> maps;
};