summaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2019-02-22 15:02:56 +0000
committerGeir Storli <geirst@verizonmedia.com>2019-02-22 15:02:56 +0000
commit218640e48925608f019bc10bc17a52b6fe56ec47 (patch)
tree047e0b5f391988c814ad1abf5ddca5c2230fb330 /staging_vespalib
parenta56fbe36bd898a24c8e5a30b6988a8e76192bf91 (diff)
Reduce code duplication in gtest runners.
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/vespa/vespalib/gtest/gtest.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/gtest/gtest.h b/staging_vespalib/src/vespa/vespalib/gtest/gtest.h
new file mode 100644
index 00000000000..ed4e65b71cb
--- /dev/null
+++ b/staging_vespalib/src/vespa/vespalib/gtest/gtest.h
@@ -0,0 +1,14 @@
+// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include <gtest/gtest.h>
+
+/**
+ * Macro for creating a main function that runs all gtests.
+ */
+#define GTEST_MAIN_RUN_ALL_TESTS \
+int \
+main(int argc, char* argv[]) \
+{ \
+ ::testing::InitGoogleTest(&argc, argv); \
+ return RUN_ALL_TESTS(); \
+}