summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Jamfile.jam1
-rw-r--r--test/perf-terrain.cpp20
2 files changed, 21 insertions, 0 deletions
diff --git a/test/Jamfile.jam b/test/Jamfile.jam
index c5c49d2..8219398 100644
--- a/test/Jamfile.jam
+++ b/test/Jamfile.jam
@@ -57,6 +57,7 @@ run test-glContextBhvr.cpp ;
run test-assetFactory.cpp : -- : [ sequence.insertion-sort [ glob-tree $(res) : *.* ] fixtures/rgb.txt test-instancing ] : <library>test ;
run perf-assetFactory.cpp : \< : test-assetFactory : <library>benchmark <library>test ;
run perf-geoData.cpp : \< : test-geoData : <library>test <library>benchmark ;
+run perf-terrain.cpp : \< : test-geoData : <library>test <library>benchmark ;
run perf-persistence.cpp : \< : test-persistence : <library>benchmark <library>test ;
run test-worker.cpp ;
run test-instancing.cpp : -- : test-glContainer : <library>test ;
diff --git a/test/perf-terrain.cpp b/test/perf-terrain.cpp
new file mode 100644
index 0000000..dbd44fa
--- /dev/null
+++ b/test/perf-terrain.cpp
@@ -0,0 +1,20 @@
+#include "game/terrain.h"
+#include "testMainWindow.h"
+#include <benchmark/benchmark.h>
+
+namespace {
+ void
+ terrainMeshgen(benchmark::State & state)
+ {
+ TestMainWindowAppBase window;
+ Terrain terrain {GeoData::loadFromAsciiGrid(FIXTURESDIR "height/SD19.asc")};
+
+ for (auto _ : state) {
+ terrain.generateMeshes();
+ }
+ }
+}
+
+BENCHMARK(terrainMeshgen);
+
+BENCHMARK_MAIN();