summaryrefslogtreecommitdiff
path: root/platform/default/mbgl
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-01-18 15:17:07 +0100
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-01-18 19:06:32 +0100
commit49da57393a5c5ddff1a7f60620c38858643b1220 (patch)
treeab03d4176afac09f8b19e79cd54c852cc65a59ba /platform/default/mbgl
parentc637a658db64c69c6052836790f5e6ef7bcda69c (diff)
downloadqtlocation-mapboxgl-49da57393a5c5ddff1a7f60620c38858643b1220.tar.gz
[core] Remove platform-specific main.cpp from MBGL_TEST_FILES
Diffstat (limited to 'platform/default/mbgl')
-rw-r--r--platform/default/mbgl/test/main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/default/mbgl/test/main.cpp b/platform/default/mbgl/test/main.cpp
new file mode 100644
index 0000000000..d01cf75ffc
--- /dev/null
+++ b/platform/default/mbgl/test/main.cpp
@@ -0,0 +1,20 @@
+#include <mbgl/test.hpp>
+#include <unistd.h>
+#include <cstring>
+#include <cerrno>
+#include <cstdio>
+
+#define xstr(s) str(s)
+#define str(s) #s
+
+int main(int argc, char *argv[]) {
+#ifdef WORK_DIRECTORY
+ const int result = chdir(xstr(WORK_DIRECTORY));
+ if (result != 0) {
+ fprintf(stderr, "failed to change directory: %s\n", strerror(errno));
+ return errno;
+ }
+#endif
+
+ return mbgl::runTests(argc, argv);
+}