From 86cfdaf526cad434c4bcf662d68eba89722f5e66 Mon Sep 17 00:00:00 2001 From: Aleksandar Stojiljkovic Date: Tue, 6 Aug 2019 16:59:25 +0300 Subject: mbgl-render-test runner - use the same tolerance as with node render test 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. --- render-test/linux-ignores.json | 5 +++++ render-test/mac-ignores.json | 5 +++++ render-test/parser.cpp | 18 +++++++++++++++--- render-test/runner.cpp | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 render-test/linux-ignores.json create mode 100644 render-test/mac-ignores.json 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> parseIgnores() { std::vector> 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::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 ignoresPaths = { mainIgnoresPath, platformSpecificIgnores }; + for (auto path: ignoresPaths) { + auto maybeIgnores = readJson(path); + if (!maybeIgnores.is()) { + continue; + } for (const auto& property : maybeIgnores.get().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); -- cgit v1.2.1