[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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user