summaryrefslogtreecommitdiff
path: root/test/fixtures/util.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixtures/util.hpp')
-rw-r--r--test/fixtures/util.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/fixtures/util.hpp b/test/fixtures/util.hpp
new file mode 100644
index 0000000000..f1201d34e7
--- /dev/null
+++ b/test/fixtures/util.hpp
@@ -0,0 +1,24 @@
+#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;
+
+namespace mbgl {
+namespace test {
+
+const std::string &getBaseDirectory();
+pid_t startServer(const char *executable);
+void stopServer(pid_t pid);
+
+}
+}
+
+#endif