summaryrefslogtreecommitdiff
path: root/render-test
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-12-12 15:43:44 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-12-12 17:03:25 +0200
commit91ba9b655ec7e9f1311a7aefa32c28f231fa8c2c (patch)
tree3919020ca6af6d8db747ae65f392356b86beaf15 /render-test
parent31742317e83113f54f6e13db09c7e90203a1917a (diff)
downloadqtlocation-mapboxgl-91ba9b655ec7e9f1311a7aefa32c28f231fa8c2c.tar.gz
[test-runner] Don't update nor create metrics baseline for ignored test
Diffstat (limited to 'render-test')
-rw-r--r--render-test/metadata.hpp1
-rw-r--r--render-test/render_test.cpp2
-rw-r--r--render-test/runner.cpp4
3 files changed, 5 insertions, 2 deletions
diff --git a/render-test/metadata.hpp b/render-test/metadata.hpp
index 32eb3455ad..ba4a875b0c 100644
--- a/render-test/metadata.hpp
+++ b/render-test/metadata.hpp
@@ -132,6 +132,7 @@ struct TestMetadata {
mbgl::JSDocument document;
bool renderTest = true;
bool outputsImage = true;
+ bool ignoredTest = false;
mbgl::Size size{ 512u, 512u };
float pixelRatio = 1.0f;
diff --git a/render-test/render_test.cpp b/render-test/render_test.cpp
index 13d6992e43..4be6d4abc1 100644
--- a/render-test/render_test.cpp
+++ b/render-test/render_test.cpp
@@ -169,7 +169,7 @@ int runRenderTests(int argc, char** argv, std::function<void()> testStatus) {
const std::string ignoreName = id;
const auto it = std::find_if(ignores.cbegin(), ignores.cend(), [&ignoreName](auto pair) { return pair.first == ignoreName; });
if (it != ignores.end()) {
- shouldIgnore = true;
+ metadata.ignoredTest = shouldIgnore = true;
ignoreReason = it->second;
if (ignoreReason.rfind("skip", 0) == 0) {
printf(ANSI_COLOR_GRAY "* skipped %s (%s)" ANSI_COLOR_RESET "\n", id.c_str(), ignoreReason.c_str());
diff --git a/render-test/runner.cpp b/render-test/runner.cpp
index 37adcc8f7c..41f7de15bd 100644
--- a/render-test/runner.cpp
+++ b/render-test/runner.cpp
@@ -315,7 +315,7 @@ bool TestRunner::checkRenderTestResults(mbgl::PremultipliedImage&& actualImage,
}
bool TestRunner::checkProbingResults(TestMetadata& resultMetadata) {
- if (resultMetadata.metrics.isEmpty()) return true;
+ if (resultMetadata.metrics.isEmpty() || resultMetadata.ignoredTest) return true;
const auto writeMetrics = [&resultMetadata](const mbgl::filesystem::path& path,
const std::string& message = std::string()) {
mbgl::filesystem::create_directories(path);
@@ -1250,6 +1250,7 @@ bool runInjectedProbe(TestMetadata& metadata,
}
bool TestRunner::runInjectedProbesBegin(TestMetadata& metadata_, RunContext& ctx_) {
+ if (metadata_.ignoredTest) return true;
const std::string mark = " - default - start";
static const InjectedProbeMap beginInjectedProbeMap = {
{// Injected memory probe begin
@@ -1284,6 +1285,7 @@ bool TestRunner::runInjectedProbesBegin(TestMetadata& metadata_, RunContext& ctx
}
bool TestRunner::runInjectedProbesEnd(TestMetadata& metadata_, RunContext& ctx_, mbgl::gfx::RenderingStats stats) {
+ if (metadata_.ignoredTest) return true;
const std::string mark = " - default - end";
static const InjectedProbeMap endInjectedProbeMap = {
{// Injected memory probe end