diff options
author | zmiao <miao.zhao@mapbox.com> | 2019-10-23 12:04:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-23 12:04:23 +0300 |
commit | 2385f4cd86261cdfc6253de5fed217bfc06fa6c8 (patch) | |
tree | 8d5e98b83efce930ff8b9454d75c3eedc8513a22 /render-test/render_test.cpp | |
parent | 99feb9bb306ddf06c228f0b6bbfb88abead6b33a (diff) | |
download | qtlocation-mapboxgl-2385f4cd86261cdfc6253de5fed217bfc06fa6c8.tar.gz |
[render-test] Add configurable rootPath, ignorePath via CLI arguments (#15832)
* [render-test] Add configurable path via CLI arguments
* [render-test] Change ignore path config
Diffstat (limited to 'render-test/render_test.cpp')
-rw-r--r-- | render-test/render_test.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/render-test/render_test.cpp b/render-test/render_test.cpp index df1658265a..2cf3f5fd65 100644 --- a/render-test/render_test.cpp +++ b/render-test/render_test.cpp @@ -44,12 +44,12 @@ int runRenderTests(int argc, char** argv) { bool shuffle; uint32_t seed; std::string testRootPath; + std::string ignoresPath; std::vector<TestPaths> testPaths; - std::tie(recycleMap, shuffle, seed, testRootPath, testPaths) = parseArguments(argc, argv); - const std::string::size_type rootLength = testRootPath.length(); + std::tie(recycleMap, shuffle, seed, testRootPath, ignoresPath, testPaths) = parseArguments(argc, argv); - const auto ignores = parseIgnores(); + const auto ignores = parseIgnores(testRootPath, ignoresPath); if (shuffle) { printf(ANSI_COLOR_YELLOW "Shuffle seed: %d" ANSI_COLOR_RESET "\n", seed); @@ -60,7 +60,7 @@ int runRenderTests(int argc, char** argv) { } mbgl::util::RunLoop runLoop; - TestRunner runner; + TestRunner runner(testRootPath); std::vector<TestMetadata> metadatas; metadatas.reserve(testPaths.size()); @@ -68,7 +68,7 @@ int runRenderTests(int argc, char** argv) { TestStatistics stats; for (auto& testPath : testPaths) { - TestMetadata metadata = parseTestMetadata(testPath); + TestMetadata metadata = parseTestMetadata(testPath, testRootPath); if (!recycleMap) { runner.reset(); @@ -78,6 +78,7 @@ int runRenderTests(int argc, char** argv) { std::string& status = metadata.status; std::string& color = metadata.color; + const std::string::size_type rootLength = getTestPath(testRootPath).length(); id = testPath.defaultExpectations(); id = id.substr(rootLength + 1, id.length() - rootLength - 2); @@ -166,4 +167,4 @@ int runRenderTests(int argc, char** argv) { return stats.failedTests + stats.erroredTests == 0 ? 0 : 1; } -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl |