summaryrefslogtreecommitdiff
path: root/render-test/runner.hpp
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-12-11 17:50:30 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-12-13 15:34:06 +0200
commit4a30f7469994dc29e5fd790952f8a16e7caab9f9 (patch)
treece55f45c1614fa4cb33764f78266cd9d194e1954 /render-test/runner.hpp
parent8b9a4571a4b72b7b4f4e5584a0fabca192964533 (diff)
downloadqtlocation-mapboxgl-4a30f7469994dc29e5fd790952f8a16e7caab9f9.tar.gz
[test runner] Introduce generic TestContext
Diffstat (limited to 'render-test/runner.hpp')
-rw-r--r--render-test/runner.hpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/render-test/runner.hpp b/render-test/runner.hpp
index b64c588e70..d278d90ec4 100644
--- a/render-test/runner.hpp
+++ b/render-test/runner.hpp
@@ -8,10 +8,24 @@
#include <memory>
#include <string>
-struct RunContext;
class TestRunnerMapObserver;
struct TestMetadata;
+class TestContext {
+public:
+ virtual mbgl::HeadlessFrontend& getFrontend() = 0;
+ virtual mbgl::Map& getMap() = 0;
+ virtual TestRunnerMapObserver& getObserver() = 0;
+ virtual TestMetadata& getMetadata() = 0;
+
+ GfxProbe activeGfxProbe;
+ GfxProbe baselineGfxProbe;
+ bool gfxProbeActive = false;
+
+protected:
+ virtual ~TestContext() = default;
+};
+
class TestRunner {
public:
enum class UpdateResults { NO, DEFAULT, PLATFORM, METRICS, REBASELINE };
@@ -24,9 +38,9 @@ public:
void doShuffle(uint32_t seed);
private:
- bool runOperations(const std::string& key, TestMetadata&, RunContext&);
- bool runInjectedProbesBegin(TestMetadata&, RunContext&);
- bool runInjectedProbesEnd(TestMetadata&, RunContext&, mbgl::gfx::RenderingStats);
+ bool runOperations(TestContext&);
+ bool runInjectedProbesBegin(TestContext&);
+ bool runInjectedProbesEnd(TestContext&, mbgl::gfx::RenderingStats);
bool checkQueryTestResults(mbgl::PremultipliedImage&& actualImage,
std::vector<mbgl::Feature>&& features,