summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com>2019-08-06 16:59:25 +0300
committerAleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com>2019-08-06 18:23:49 +0300
commit86cfdaf526cad434c4bcf662d68eba89722f5e66 (patch)
tree0e194aa3a105104e59de637438adb8bc184a96b0
parentacfcd5c29c15e91e3bf80b1503d63caef1487149 (diff)
downloadqtlocation-mapboxgl-upstream/astojilj-render-test-tolerance.tar.gz
mbgl-render-test runner - use the same tolerance as with node render testupstream/astojilj-render-test-tolerance
Two render tests failing only with mbgl-render-tests are added to platform specific ignores. This is to be extended with fill-extrusion-pattern failing only on mac.
-rw-r--r--render-test/linux-ignores.json5
-rw-r--r--render-test/mac-ignores.json5
-rw-r--r--render-test/parser.cpp18
-rw-r--r--render-test/runner.cpp2
4 files changed, 26 insertions, 4 deletions
diff --git a/render-test/linux-ignores.json b/render-test/linux-ignores.json
new file mode 100644
index 0000000000..87bef31c5c
--- /dev/null
+++ b/render-test/linux-ignores.json
@@ -0,0 +1,5 @@
+{
+ "render-tests/regressions/mapbox-gl-js#7066": "Failing with mbgl-render-test",
+ "render-tests/regressions/mapbox-gl-js#5642": "Failing with mbgl-render-test"
+}
+
diff --git a/render-test/mac-ignores.json b/render-test/mac-ignores.json
new file mode 100644
index 0000000000..87bef31c5c
--- /dev/null
+++ b/render-test/mac-ignores.json
@@ -0,0 +1,5 @@
+{
+ "render-tests/regressions/mapbox-gl-js#7066": "Failing with mbgl-render-test",
+ "render-tests/regressions/mapbox-gl-js#5642": "Failing with mbgl-render-test"
+}
+
diff --git a/render-test/parser.cpp b/render-test/parser.cpp
index 089a5c45c9..fd048f08c6 100644
--- a/render-test/parser.cpp
+++ b/render-test/parser.cpp
@@ -260,10 +260,22 @@ ArgumentsTuple parseArguments(int argc, char** argv) {
std::vector<std::pair<std::string, std::string>> parseIgnores() {
std::vector<std::pair<std::string, std::string>> ignores;
- auto path = mbgl::filesystem::path(TEST_RUNNER_ROOT_PATH).append("platform/node/test/ignores.json");
+ auto mainIgnoresPath = mbgl::filesystem::path(TEST_RUNNER_ROOT_PATH).append("platform/node/test/ignores.json");
- auto maybeIgnores = readJson(path.string());
- if (maybeIgnores.is<mbgl::JSDocument>()) {
+ mbgl::filesystem::path platformSpecificIgnores;
+
+#ifdef __APPLE__
+ platformSpecificIgnores = mbgl::filesystem::path(TEST_RUNNER_ROOT_PATH).append("render-test/mac-ignores.json");
+#elif __linux__
+ platformSpecificIgnores = mbgl::filesystem::path(TEST_RUNNER_ROOT_PATH).append("render-test/linux-ignores.json");
+#endif
+
+ std::vector<mbgl::filesystem::path> ignoresPaths = { mainIgnoresPath, platformSpecificIgnores };
+ for (auto path: ignoresPaths) {
+ auto maybeIgnores = readJson(path);
+ if (!maybeIgnores.is<mbgl::JSDocument>()) {
+ continue;
+ }
for (const auto& property : maybeIgnores.get<mbgl::JSDocument>().GetObject()) {
const std::string ignore = { property.name.GetString(),
property.name.GetStringLength() };
diff --git a/render-test/runner.cpp b/render-test/runner.cpp
index dd6aef3a54..5bd855c43a 100644
--- a/render-test/runner.cpp
+++ b/render-test/runner.cpp
@@ -62,7 +62,7 @@ bool TestRunner::checkImage(mbgl::PremultipliedImage&& actual, TestMetadata& met
pixels = // implicitly converting from uint64_t
mapbox::pixelmatch(actual.data.get(), expected.data.get(), expected.size.width,
- expected.size.height, diff.data.get(), 0.16); // GL JS uses 0.1285
+ expected.size.height, diff.data.get(), 0.1285); // Defined in GL JS
metadata.diff = mbgl::encodePNG(diff);