Skip to content

Commit

Permalink
Enable HTTP test server on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tdcosta100 committed Nov 11, 2024
1 parent fe8517e commit 0fcafac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ if(MLN_WITH_METAL)
)
endif()

if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Android)
if(CMAKE_SYSTEM_NAME STREQUAL Android)
message("Target platform does not support HTTP tests or dependencies not found.")

set(MLN_TEST_HAS_TEST_SERVER 0)
Expand Down Expand Up @@ -263,7 +263,7 @@ if (MLN_WITH_CLANG_TIDY)
set_target_properties(mbgl-test PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
endif()

if (CMAKE_SYSTEM_NAME STREQUAL Linux)
if (WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Linux)
target_compile_definitions(
mbgl-test
PRIVATE USE_CPP_TEST_SERVER
Expand Down
2 changes: 1 addition & 1 deletion test/src/mbgl/test/http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void runServer(std::unique_ptr<httplib::Server>& server) {
});

server->Get("/delayed", [](const Request&, Response& res) {
usleep(200000);
std::this_thread::sleep_for(std::chrono::milliseconds(200));
res.status = 200;
res.set_content("Response", "text/plain");
});
Expand Down

0 comments on commit 0fcafac

Please sign in to comment.