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 Oct 25, 2024
1 parent 1e5ee01 commit a9a8a41
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 @@ -171,7 +171,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 @@ -262,7 +262,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 a9a8a41

Please sign in to comment.