From 5dfeee3cb20ad6405b7a50ec09c2b5fdd4ea4323 Mon Sep 17 00:00:00 2001 From: zmiao Date: Tue, 29 Oct 2019 17:40:54 +0200 Subject: [render-test] Add linux probe manifest --- circle.yml | 4 +++- cmake/render-test.cmake | 2 ++ next/platform/linux/linux.cmake | 5 ++++- next/platform/macos/macos.cmake | 2 +- render-test/linux-probe-manifest.json | 7 +++++++ render-test/mac-probe-manifest.json | 7 +++++++ render-test/probe-manifest.json | 7 ------- render-test/render_test.cpp | 6 ++++-- 8 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 render-test/linux-probe-manifest.json create mode 100644 render-test/mac-probe-manifest.json delete mode 100644 render-test/probe-manifest.json diff --git a/circle.yml b/circle.yml index a109ef2b41..ad4dc8bfd0 100644 --- a/circle.yml +++ b/circle.yml @@ -267,7 +267,9 @@ commands: when: on_fail command: | mkdir -p /tmp/tests/render - if [ -f render-test/index.html ]; then cp render-test/index.html /tmp/tests/render; fi + if [ -f render-test/tests_index.html ]; then cp render-test/tests_index.html /tmp/tests/render; fi + if [ -f render-test/render-tests_index.html ]; then cp render-test/render-tests_index.html /tmp/tests/render; fi + if [ -f render-test/query-tests_index.html ]; then cp render-test/query-tests_index.html /tmp/tests/render; fi mkdir -p /tmp/tests/coredumps if ls core* 1> /dev/null 2>&1; then cp core* /tmp/tests/coredumps; fi - store_artifacts: diff --git a/cmake/render-test.cmake b/cmake/render-test.cmake index 8726fb4650..ac17be559c 100644 --- a/cmake/render-test.cmake +++ b/cmake/render-test.cmake @@ -8,6 +8,8 @@ add_executable( render-test/filesystem.hpp render-test/filesystem.hpp render-test/include/mbgl/render_test.hpp + render-test/manifest_parser.cpp + render-test/manifest_parser.hpp render-test/metadata.hpp render-test/parser.cpp render-test/parser.hpp diff --git a/next/platform/linux/linux.cmake b/next/platform/linux/linux.cmake index 9b821cdbea..396b9a0ffd 100644 --- a/next/platform/linux/linux.cmake +++ b/next/platform/linux/linux.cmake @@ -148,5 +148,8 @@ add_test( --seed=${MBGL_RENDER_TEST_SEED} ) -add_test(NAME mbgl-render-test-probes COMMAND mbgl-render-test-runner tests --manifestPath=${MBGL_ROOT}/render-test/probe-manifest.json) +add_test( + NAME mbgl-render-test-probes + COMMAND mbgl-render-test-runner tests --manifestPath=${MBGL_ROOT}/render-test/linux-probe-manifest.json +) add_test(NAME mbgl-query-test COMMAND mbgl-render-test-runner query-tests --manifestPath=${MBGL_ROOT}/render-test/linux-manifest.json) diff --git a/next/platform/macos/macos.cmake b/next/platform/macos/macos.cmake index 229b2cc9e3..721d19e625 100644 --- a/next/platform/macos/macos.cmake +++ b/next/platform/macos/macos.cmake @@ -212,6 +212,6 @@ add_test( --seed=${MBGL_RENDER_TEST_SEED} ) -add_test(NAME mbgl-render-test-probes COMMAND mbgl-render-test-runner tests --manifestPath=${MBGL_ROOT}/render-test/probe-manifest.json) +add_test(NAME mbgl-render-test-probes COMMAND mbgl-render-test-runner tests --manifestPath=${MBGL_ROOT}/render-test/mac-probe-manifest.json) add_test(NAME mbgl-query-test COMMAND mbgl-render-test-runner query-tests --manifestPath=${MBGL_ROOT}/render-test/mac-manifest.json) diff --git a/render-test/linux-probe-manifest.json b/render-test/linux-probe-manifest.json new file mode 100644 index 0000000000..0b2ca88988 --- /dev/null +++ b/render-test/linux-probe-manifest.json @@ -0,0 +1,7 @@ +{ + "probe_test_path":".", + "expectation_paths":["expected/render-tests"], + "ignore_paths":["../render-test/linux-ignores.json", "../render-test/tests/should-fail.json"], + "vendor_path":"../vendor", + "asset_path": "../mapbox-gl-js/test/integration" +} \ No newline at end of file diff --git a/render-test/mac-probe-manifest.json b/render-test/mac-probe-manifest.json new file mode 100644 index 0000000000..f3cc56d0a8 --- /dev/null +++ b/render-test/mac-probe-manifest.json @@ -0,0 +1,7 @@ +{ + "probe_test_path":".", + "expectation_paths":["expected/render-tests", "tests/mac"], + "ignore_paths":["../render-test/mac-ignores.json", "../render-test/tests/should-fail.json"], + "vendor_path":"../vendor", + "asset_path": "../mapbox-gl-js/test/integration" +} \ No newline at end of file diff --git a/render-test/probe-manifest.json b/render-test/probe-manifest.json deleted file mode 100644 index f3cc56d0a8..0000000000 --- a/render-test/probe-manifest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "probe_test_path":".", - "expectation_paths":["expected/render-tests", "tests/mac"], - "ignore_paths":["../render-test/mac-ignores.json", "../render-test/tests/should-fail.json"], - "vendor_path":"../vendor", - "asset_path": "../mapbox-gl-js/test/integration" -} \ No newline at end of file diff --git a/render-test/render_test.cpp b/render-test/render_test.cpp index 85c716dabb..38d6c15f3f 100644 --- a/render-test/render_test.cpp +++ b/render-test/render_test.cpp @@ -200,8 +200,10 @@ int runRenderTests(int argc, char** argv) { metadatas.push_back(std::move(metadata)); } const auto& testRootPath = manifest.getManifestPath(); + const auto resultPath = + testRootPath + "/" + (testNames.empty() ? "render-tests" : testNames.front()) + "_index.html"; std::string resultsHTML = createResultPage(stats, metadatas, shuffle, seed); - mbgl::util::write_file(testRootPath + "/index.html", resultsHTML); + mbgl::util::write_file(resultPath, resultsHTML); const uint32_t count = stats.erroredTests + stats.failedTests + stats.ignoreFailedTests + stats.ignorePassedTests + stats.passedTests; @@ -222,7 +224,7 @@ int runRenderTests(int argc, char** argv) { printf(ANSI_COLOR_RED "%u errored (%.1lf%%)" ANSI_COLOR_RESET "\n", stats.erroredTests, 100.0 * stats.erroredTests / count); } - printf("Results at: %s%s\n", testRootPath.c_str(), "/index.html"); + printf("Results at: %s\n", resultPath.c_str()); return stats.failedTests + stats.erroredTests == 0 ? 0 : 1; } -- cgit v1.2.1