summaryrefslogtreecommitdiff
path: root/render-test
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-29 15:07:42 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-12-02 12:07:37 +0200
commit0c348a8acfcbb86c43b0d1764388a0d247b84404 (patch)
treecf37f056ba516013924b529c920bb5fa6991bc1f /render-test
parent00d133239e22fc6df84f81596820ca46afb351bb (diff)
downloadqtlocation-mapboxgl-0c348a8acfcbb86c43b0d1764388a0d247b84404.tar.gz
[test-runner] Log all 'probeFileSize' failures
If there are multiple file size probes in a test file, it is better to report all failures instead of first failed probe.
Diffstat (limited to 'render-test')
-rw-r--r--render-test/runner.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/render-test/runner.cpp b/render-test/runner.cpp
index 24bc6668d7..4f4c163b7d 100644
--- a/render-test/runner.cpp
+++ b/render-test/runner.cpp
@@ -360,6 +360,7 @@ bool TestRunner::checkProbingResults(TestMetadata& metadata) {
// Check file size metrics.
auto checkFileSize = [](TestMetadata& metadata) -> bool {
if (metadata.metrics.fileSize.empty()) return true;
+ bool passed = true;
for (const auto& expected : metadata.expectedMetrics.fileSize) {
auto actual = metadata.metrics.fileSize.find(expected.first);
if (actual == metadata.metrics.fileSize.end()) {
@@ -378,14 +379,16 @@ bool TestRunner::checkProbingResults(TestMetadata& metadata) {
auto result = checkValue(expected.second.size, actual->second.size, actual->second.tolerance);
if (!std::get<bool>(result)) {
std::stringstream ss;
- ss << "File size does not match at probe \"" << expected.first << "\": " << actual->second.size
- << ", expected is " << expected.second.size << ".";
+ ss << "File size does not match at probe \"" << expected.first << "\" for file \""
+ << expected.second.path << "\": " << actual->second.size << ", expected is " << expected.second.size
+ << ".";
- metadata.errorMessage = ss.str();
- return false;
+ metadata.errorMessage += metadata.errorMessage.empty() ? ss.str() : "\n" + ss.str();
+ passed = false;
+ continue;
}
}
- return true;
+ return passed;
};
auto checkMemory = [](TestMetadata& metadata) -> bool {
if (metadata.metrics.memory.empty()) return true;