summaryrefslogtreecommitdiff
path: root/test/include
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2020-01-14 15:25:36 +0200
committerJuha Alanen <juha.alanen@mapbox.com>2020-01-30 13:52:09 +0200
commitb0e16ec9cb353150355580aa544e4284fe11b8fe (patch)
tree537b687f636842b0c16882cd3bfc75af4322f4b0 /test/include
parentad18b0d7894add6020c052ae562feefee1e9452f (diff)
downloadqtlocation-mapboxgl-b0e16ec9cb353150355580aa544e4284fe11b8fe.tar.gz
[test] Switch to C++ HTTP server
Diffstat (limited to 'test/include')
-rw-r--r--test/include/mbgl/test/util.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/include/mbgl/test/util.hpp b/test/include/mbgl/test/util.hpp
index 9f56841dcc..b499b5750c 100644
--- a/test/include/mbgl/test/util.hpp
+++ b/test/include/mbgl/test/util.hpp
@@ -54,9 +54,14 @@
#include <cstdint>
#include <memory>
+#include <thread>
#include <gtest/gtest.h>
+namespace httplib {
+class Server;
+}
+
namespace mbgl {
namespace test {
@@ -69,6 +74,16 @@ private:
int fd = -1;
};
+class HttpServer {
+public:
+ HttpServer();
+ ~HttpServer();
+
+private:
+ std::unique_ptr<httplib::Server> server;
+ std::thread serverThread;
+};
+
void checkImage(const std::string& base,
const PremultipliedImage& actual,
double imageThreshold = 0,