Files
MapLibreParticleLab/render-test/runner.hpp
Mikhail Pozdnyakov a1904e802c [test-runner] Introduce mapbox-gl-native test expectations
The `mapbox-gl-native`-specific render tests expected results will
be stored at the `render-test/expected/` subfolder.

Test runner will automatically put new expected results there if
invoked with `UPDATE=true`.
2019-08-16 16:25:59 +03:00

33 lines
794 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();
/// Returns path of mapbox-gl-native expectations directory.
static const std::string& getPlatformExpectationsPath();
private:
bool runOperations(const std::string& key, TestMetadata&);
bool checkImage(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;
};