diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-11-26 11:54:08 +0200 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-11-27 16:43:33 +0200 |
commit | 2f8501043cb037234a5db82a2f32b49b29fdf8c8 (patch) | |
tree | bf662d30afa66b79aba4ec8afaaab0d8246c5e79 /render-test/manifest_parser.cpp | |
parent | f10097640a8a62f9a139952844a75ac9b0b12543 (diff) | |
download | qtlocation-mapboxgl-2f8501043cb037234a5db82a2f32b49b29fdf8c8.tar.gz |
[test-runner] Move probe related command line args to manifest
- Move probe related command line arguments to manifest, example:
"probes": ["probeGFX", "probeNetwork", "probeMemory"],
"metric_path": "metrics/linux"
- Use manifest file name as a postfix for a result page
- Move injected probes 'begin' section before map object creation
- Generalize artifact storing shell script
Diffstat (limited to 'render-test/manifest_parser.cpp')
-rw-r--r-- | render-test/manifest_parser.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/render-test/manifest_parser.cpp b/render-test/manifest_parser.cpp index 01d2246685..bcc10c91d4 100644 --- a/render-test/manifest_parser.cpp +++ b/render-test/manifest_parser.cpp @@ -44,6 +44,10 @@ const std::string& Manifest::getResultPath() const { return resultPath; } +const std::set<std::string>& Manifest::getProbes() const { + return probes; +} + void Manifest::doShuffle(uint32_t seed) { std::seed_seq sequence{seed}; std::mt19937 shuffler(sequence); @@ -389,6 +393,25 @@ mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manife manifest.ignores = parseIgnores(ignorePaths); } + if (document.HasMember("probes")) { + const auto& probesValue = document["probes"]; + if (!probesValue.IsArray()) { + mbgl::Log::Warning(mbgl::Event::General, + "Provided probes inside the manifest file: %s is not a valid array", + filePath.c_str()); + return mbgl::nullopt; + } + for (const auto& value : probesValue.GetArray()) { + if (!value.IsString()) { + mbgl::Log::Warning(mbgl::Event::General, + "Invalid probe type is provoided inside the manifest file: %s", + filePath.c_str()); + return mbgl::nullopt; + } + manifest.probes.emplace(value.GetString()); + } + } + manifest.testRootPath = enbaleProbeTest ? probeTestPath.string() : baseTestPath.string(); if (manifest.testRootPath.back() == '/') { manifest.testRootPath.pop_back(); |