[test runner] Tests for memory size metrics

This commit is contained in:
Mikhail Pozdnyakov
2019-10-11 14:06:02 +03:00
parent 9adc78134c
commit b0976feca2
11 changed files with 163 additions and 2 deletions

View File

@@ -292,7 +292,7 @@ bool TestRunner::checkRenderTestResults(mbgl::PremultipliedImage&& actualImage,
if (!passed) {
std::stringstream ss;
ss << "Number of allocations at probe \"" << expected.first << "\" is " << actual->second.allocations
<< ", expected is " << expected.second.allocations << "±" << delta << " allocations.";
<< ", expected is " << expected.second.allocations << "±" << std::round(delta) << " allocations.";
metadata.errorMessage = ss.str();
return false;

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

View File

@@ -0,0 +1 @@
{"memory":[["after setZoom 0.9",33271,62],["end",40000,118],["start",0,0]]}

View File

@@ -0,0 +1,52 @@
{
"version": 8,
"metadata": {
"test": {
"width": 64,
"height": 64,
"operations": [
[ "wait" ],
[ "probeMemoryStart" ],
[ "probeMemory", "start" ],
[
"setZoom",
0.9
],
[
"wait"
],
[ "probeMemory", "after setZoom 0.9", 0.005 ],
[
"setLayerZoomRange",
"circle",
1,
2
],
[
"wait"
],
[ "probeMemory", "end", 0.005 ],
[ "probeMemoryEnd" ]
]
}
},
"sources": {
"geojson": {
"type": "geojson",
"data": {
"type": "Point",
"coordinates": [
0,
0
]
}
}
},
"layers": [
{
"id": "circle",
"type": "circle",
"source": "geojson"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

View File

@@ -0,0 +1 @@
{"memory":[["after setZoom 0.9",33271,62],["end",60000,118],["start",0,0]]}

View File

@@ -0,0 +1,52 @@
{
"version": 8,
"metadata": {
"test": {
"width": 64,
"height": 64,
"operations": [
[ "wait" ],
[ "probeMemoryStart" ],
[ "probeMemory", "start" ],
[
"setZoom",
0.9
],
[
"wait"
],
[ "probeMemory", "after setZoom 0.9", 0.005 ],
[
"setLayerZoomRange",
"circle",
1,
2
],
[
"wait"
],
[ "probeMemory", "end", 0.005 ],
[ "probeMemoryEnd" ]
]
}
},
"sources": {
"geojson": {
"type": "geojson",
"data": {
"type": "Point",
"coordinates": [
0,
0
]
}
}
},
"layers": [
{
"id": "circle",
"type": "circle",
"source": "geojson"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

View File

@@ -0,0 +1 @@
{"memory":[["after setZoom 0.9",33271,62],["end",47833,118],["start",0,0]]}

View File

@@ -0,0 +1,52 @@
{
"version": 8,
"metadata": {
"test": {
"width": 64,
"height": 64,
"operations": [
[ "wait" ],
[ "probeMemoryStart" ],
[ "probeMemory", "start" ],
[
"setZoom",
0.9
],
[
"wait"
],
[ "probeMemory", "after setZoom 0.9", 0.005 ],
[
"setLayerZoomRange",
"circle",
1,
2
],
[
"wait"
],
[ "probeMemory", "end", 0.005 ],
[ "probeMemoryEnd" ]
]
}
},
"sources": {
"geojson": {
"type": "geojson",
"data": {
"type": "Point",
"coordinates": [
0,
0
]
}
}
},
"layers": [
{
"id": "circle",
"type": "circle",
"source": "geojson"
}
]
}

View File

@@ -5,5 +5,7 @@
"tests/file-size/fail-file-not-found": "Should fail, file not found.",
"tests/network/fail-requests": "Should fail, number of requests higher than expected.",
"tests/network/fail-transferred": "Should fail, amount of transferred data higher than expected.",
"tests/network/fail-requests-transferred": "Should fail, number of requests higher than expected and amount of transferred data less than expected."
"tests/network/fail-requests-transferred": "Should fail, number of requests higher than expected and amount of transferred data less than expected.",
"tests/memory/fail-memory-size-is-too-big": "Should fail, memory size is bigger than expected.",
"tests/memory/fail-memory-size-is-too-small": "Should fail, memory size is smaller than expected."
}