aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/gbenchmark/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'library/cpp/testing/gbenchmark/main.cpp')
-rw-r--r--library/cpp/testing/gbenchmark/main.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/library/cpp/testing/gbenchmark/main.cpp b/library/cpp/testing/gbenchmark/main.cpp
new file mode 100644
index 0000000000..523d18901a
--- /dev/null
+++ b/library/cpp/testing/gbenchmark/main.cpp
@@ -0,0 +1,16 @@
+#include <benchmark/benchmark.h>
+
+#include <library/cpp/testing/hook/hook.h>
+#include <util/generic/scope.h>
+
+int main(int argc, char** argv) {
+ NTesting::THook::CallBeforeInit();
+ ::benchmark::Initialize(&argc, argv);
+ if (::benchmark::ReportUnrecognizedArguments(argc, argv)) {
+ return 1;
+ }
+ NTesting::THook::CallBeforeRun();
+ Y_DEFER { NTesting::THook::CallAfterRun(); };
+ ::benchmark::RunSpecifiedBenchmarks();
+ return 0;
+}