summaryrefslogtreecommitdiff
path: root/render-test/manifest_parser.cpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-12-03 13:15:45 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-12-03 16:26:22 +0200
commit41324842b294d9d38eb42f1b8726e270510614e0 (patch)
treeb92364de715385bbb05e5a45e4448b48507ce062 /render-test/manifest_parser.cpp
parent75f8530ed1d9213691b652cd6fa4ce22054645b1 (diff)
downloadqtlocation-mapboxgl-41324842b294d9d38eb42f1b8726e270510614e0.tar.gz
[test-runner] Allow to define filter inside manifest file
Command line option is still available and allows to override filter that is defined in a manifest file.
Diffstat (limited to 'render-test/manifest_parser.cpp')
-rw-r--r--render-test/manifest_parser.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/render-test/manifest_parser.cpp b/render-test/manifest_parser.cpp
index bcc10c91d4..e3217f0f50 100644
--- a/render-test/manifest_parser.cpp
+++ b/render-test/manifest_parser.cpp
@@ -257,7 +257,7 @@ mbgl::filesystem::path getValidPath(const std::string& manifestPath, const std::
mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manifestPath,
const std::vector<std::string>& testNames,
- const std::string& testFilter) {
+ std::string testFilter) {
Manifest manifest;
const auto filePath = mbgl::filesystem::path(manifestPath);
manifest.manifestPath = manifestPath.substr(0, manifestPath.find(filePath.filename()));
@@ -412,6 +412,17 @@ mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manife
}
}
+ if (testFilter.empty() && document.HasMember("filter")) {
+ const auto& filterValue = document["filter"];
+ if (!filterValue.IsString()) {
+ mbgl::Log::Warning(
+ mbgl::Event::General, "Invalid filter is provoided inside the manifest file: %s", filePath.c_str());
+ return mbgl::nullopt;
+ }
+
+ testFilter = filterValue.GetString();
+ }
+
manifest.testRootPath = enbaleProbeTest ? probeTestPath.string() : baseTestPath.string();
if (manifest.testRootPath.back() == '/') {
manifest.testRootPath.pop_back();