summaryrefslogtreecommitdiff
path: root/test/perf-terrain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/perf-terrain.cpp')
-rw-r--r--test/perf-terrain.cpp20
1 files changed, 20 insertions, 0 deletions
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();