summaryrefslogtreecommitdiff
path: root/render-test/runner.cpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-26 11:54:08 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-27 16:43:33 +0200
commit2f8501043cb037234a5db82a2f32b49b29fdf8c8 (patch)
treebf662d30afa66b79aba4ec8afaaab0d8246c5e79 /render-test/runner.cpp
parentf10097640a8a62f9a139952844a75ac9b0b12543 (diff)
downloadqtlocation-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/runner.cpp')
-rw-r--r--render-test/runner.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/render-test/runner.cpp b/render-test/runner.cpp
index 5a28576d85..c58095dd14 100644
--- a/render-test/runner.cpp
+++ b/render-test/runner.cpp
@@ -1162,10 +1162,17 @@ TestRunner::Impl::Impl(const TestMetadata& metadata)
TestRunner::Impl::~Impl() {}
-bool TestRunner::run(TestMetadata& metadata, const std::set<std::string>& injectedProbes) {
+bool TestRunner::run(TestMetadata& metadata) {
AllocationIndex::setActive(false);
AllocationIndex::reset();
ProxyFileSource::setTrackingActive(false);
+
+ RunContext ctx{};
+ // Run 'begin' probes provided via command line arguments.
+ if (!runInjectedProbesBegin(metadata, ctx)) {
+ return false;
+ }
+
std::string key = mbgl::util::toString(uint32_t(metadata.mapMode))
+ "/" + mbgl::util::toString(metadata.pixelRatio)
+ "/" + mbgl::util::toString(uint32_t(metadata.crossSourceCollisions));
@@ -1177,13 +1184,6 @@ bool TestRunner::run(TestMetadata& metadata, const std::set<std::string>& inject
auto& frontend = maps[key]->frontend;
auto& map = maps[key]->map;
- RunContext ctx{};
-
- // Run 'begin' probes provided via command line arguments.
- if (!runInjectedProbesBegin(metadata, injectedProbes, ctx)) {
- return false;
- }
-
frontend.setSize(metadata.size);
map.setSize(metadata.size);
@@ -1203,7 +1203,7 @@ bool TestRunner::run(TestMetadata& metadata, const std::set<std::string>& inject
}
// Run 'end' probes provided via command line arguments
- if (!runInjectedProbesEnd(metadata, injectedProbes, ctx, result.stats)) {
+ if (!runInjectedProbesEnd(metadata, ctx, result.stats)) {
return false;
}
@@ -1238,7 +1238,7 @@ bool runInjectedProbe(TestMetadata& metadata,
return true;
}
-bool TestRunner::runInjectedProbesBegin(TestMetadata& metadata, const std::set<std::string>& probes, RunContext& ctx) {
+bool TestRunner::runInjectedProbesBegin(TestMetadata& metadata, RunContext& ctx) {
const std::string mark = " - default - start";
static const InjectedProbeMap beginInjectedProbeMap = {
{// Injected memory probe begin
@@ -1269,11 +1269,10 @@ bool TestRunner::runInjectedProbesBegin(TestMetadata& metadata, const std::set<s
std::forward_as_tuple(ProxyFileSource::getRequestCount(), ProxyFileSource::getTransferredSize()));
}}};
- return runInjectedProbe(metadata, probes, ctx, beginInjectedProbeMap);
+ return runInjectedProbe(metadata, manifest.getProbes(), ctx, beginInjectedProbeMap);
}
bool TestRunner::runInjectedProbesEnd(TestMetadata& metadata,
- const std::set<std::string>& probes,
RunContext& ctx,
mbgl::gfx::RenderingStats stats) {
const std::string mark = " - default - end";
@@ -1319,7 +1318,7 @@ bool TestRunner::runInjectedProbesEnd(TestMetadata& metadata,
ProxyFileSource::setTrackingActive(false);
}}};
- return runInjectedProbe(metadata, probes, ctx, endInjectedProbeMap);
+ return runInjectedProbe(metadata, manifest.getProbes(), ctx, endInjectedProbeMap);
}
void TestRunner::reset() {