diff options
author | zmiao <miao.zhao@mapbox.com> | 2019-11-27 11:08:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-27 11:08:55 +0200 |
commit | 11321497da66b1f4b05dc23a9b1b0b434018b661 (patch) | |
tree | e948f74c1ea5ae1106209c0b691fe43de7d0e50a /render-test/parser.cpp | |
parent | 5c271dba2417a235003bf12ea419e890ed0fb59b (diff) | |
download | qtlocation-mapboxgl-11321497da66b1f4b05dc23a9b1b0b434018b661.tar.gz |
[render-test] Add metric_paths into Manifest (#15973)
* [render-test]Add expected metrics path in manifest file
* seperate metrics.json and expected.png
* fix expected path parsing
* keep expectation path if update is enabled
Diffstat (limited to 'render-test/parser.cpp')
-rw-r--r-- | render-test/parser.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/render-test/parser.cpp b/render-test/parser.cpp index b5d48d23a1..b5f4f9e759 100644 --- a/render-test/parser.cpp +++ b/render-test/parser.cpp @@ -275,16 +275,16 @@ std::string serializeMetrics(const TestMetrics& metrics) { namespace { std::vector<std::string> readExpectedEntries(const std::regex& regex, const mbgl::filesystem::path& base) { - std::vector<std::string> expectedImages; + std::vector<std::string> expectedEntries; for (const auto& entry : mbgl::filesystem::directory_iterator(base)) { if (entry.is_regular_file()) { const std::string path = entry.path().string(); if (std::regex_match(path, regex)) { - expectedImages.emplace_back(std::move(path)); + expectedEntries.emplace_back(std::move(path)); } } } - return expectedImages; + return expectedEntries; } } // namespace @@ -293,6 +293,11 @@ std::vector<std::string> readExpectedImageEntries(const mbgl::filesystem::path& return readExpectedEntries(regex, base); } +std::vector<std::string> readExpectedMetricEntries(const mbgl::filesystem::path& base) { + static const std::regex regex(".*metrics.*.json"); + return readExpectedEntries(regex, base); +} + std::vector<std::string> readExpectedJSONEntries(const mbgl::filesystem::path& base) { static const std::regex regex(".*expected.*.json"); return readExpectedEntries(regex, base); |