pmaports/main/net-cpp/0002-Don-t-bundle-httpbin-don-t-fail-silently.patch

45 lines
1.5 KiB
Diff
Raw Normal View History

From e028baabc3627d5d13b9a9db2d096990ce7b7459 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 9 Feb 2019 01:32:13 +0100
Subject: [PATCH 2/3] Don't bundle httpbin, don't fail silently
---
tests/CMakeLists.txt | 4 ----
tests/httpbin.h.in | 2 +-
tests/httpbin.tar.bz2 | Bin 15383 -> 0 bytes
3 files changed, 1 insertion(+), 5 deletions(-)
delete mode 100644 tests/httpbin.tar.bz2
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a21e322..0fcea99 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -14,10 +14,6 @@
#
# Authored by: Thomas Voss <thomas.voss@canonical.com>
-execute_process(
- COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_CURRENT_SOURCE_DIR}/httpbin.tar.bz2
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/httpbin.h.in
${CMAKE_CURRENT_BINARY_DIR}/httpbin.h
diff --git a/tests/httpbin.h.in b/tests/httpbin.h.in
index 30703a2..0010068 100644
--- a/tests/httpbin.h.in
+++ b/tests/httpbin.h.in
@@ -42,7 +42,7 @@ struct Instance
Instance()
: server
{
- core::posix::exec("/usr/bin/python", {"@CMAKE_CURRENT_BINARY_DIR@/httpbin/run.py"}, {}, core::posix::StandardStream::stdout | core::posix::StandardStream::stderr)
+ core::posix::exec("/usr/bin/python3", {"-c", "from httpbin import app; app.run()"}, {}, core::posix::StandardStream::stdout /*| core::posix::StandardStream::stderr*/)
}
{
std::this_thread::sleep_for(std::chrono::milliseconds{1000});
--
2.20.1