summaryrefslogtreecommitdiff
path: root/test/util.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/util.hpp')
-rw-r--r--test/util.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/util.hpp b/test/util.hpp
new file mode 100644
index 0000000000..3511662c88
--- /dev/null
+++ b/test/util.hpp
@@ -0,0 +1,14 @@
+#ifndef MBGL_TEST_UTIL
+#define MBGL_TEST_UTIL
+
+#include <gtest/gtest.h>
+
+#define SCOPED_TEST(name) \
+ static class name { \
+ bool completed = false; \
+ public: \
+ void finish() { EXPECT_FALSE(completed) << #name " was already completed."; completed = true; } \
+ ~name() { if (!completed) ADD_FAILURE() << #name " didn't complete."; } \
+ } name;
+
+#endif