From 7ec8e33b83e704a44dc91d69494418bea7b87297 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 12 May 2020 17:37:46 +0200 Subject: [PATCH 1/2] Fix include of `httplib.h` on windows. On windows, `httplib.h` must be included before `windows.h` We do not include directly `windows.h` in the test but it is included indirectly by other headers. Let's include httplib first. --- test/server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/server.cpp b/test/server.cpp index 1477806da..6ed18e409 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -1,10 +1,11 @@ + +#include "./httplib.h" #include "gtest/gtest.h" #include "../include/manager.h" #include "../include/server.h" #include "../include/name_mapper.h" -#include "./httplib.h" using TestContextImpl = std::vector >; struct TestContext : TestContextImpl { From d8498fd655127972e05427a6915d6456c801dcf0 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 18 May 2020 11:19:53 +0200 Subject: [PATCH 2/2] Do not build `server` test on windows. On the appveyor CI, the link of the `server` test fails with `libmicrohttpd`. Do not build the test on windows to not break the CI. --- test/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/meson.build b/test/meson.build index 2528c36b0..bfbe9a7a3 100644 --- a/test/meson.build +++ b/test/meson.build @@ -12,9 +12,13 @@ tests = [ 'kiwixserve', 'book', 'manager', - 'server' ] +if build_machine.system() != 'windows' + tests += ['server'] +endif + + gtest_dep = dependency('gtest', main:true,