git: b38eb689eb2c - main - www/cpp-httplib: Add test target
Yuri Victorovich
yuri at FreeBSD.org
Tue Aug 24 17:35:58 UTC 2021
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=b38eb689eb2c1a460ead94c7ea2a5f547d4c2fc0
commit b38eb689eb2c1a460ead94c7ea2a5f547d4c2fc0
Author: Yuri Victorovich <yuri at FreeBSD.org>
AuthorDate: 2021-08-24 17:35:19 +0000
Commit: Yuri Victorovich <yuri at FreeBSD.org>
CommitDate: 2021-08-24 17:35:52 +0000
www/cpp-httplib: Add test target
---
www/cpp-httplib/Makefile | 9 ++++++++-
www/cpp-httplib/files/patch-test_Makefile | 26 ++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/www/cpp-httplib/Makefile b/www/cpp-httplib/Makefile
index c455afd27fa7..b06955ab1e3a 100644
--- a/www/cpp-httplib/Makefile
+++ b/www/cpp-httplib/Makefile
@@ -9,7 +9,9 @@ COMMENT= C++ header-only HTTP/HTTPS server and client library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= cmake
+TEST_DEPENDS= gmake:devel/gmake
+
+USES= cmake localbase:ldflags python:test # localbase only for tests
USE_GITHUB= yes
GH_ACCOUNT= yhirose
@@ -18,6 +20,8 @@ CMAKE_ON= HTTPLIB_REQUIRE_ZLIB
NO_ARCH= yes
+BINARY_ALIAS= python3=${PYTHON_CMD} # only for tests
+
PLIST_FILES= include/httplib.h \
lib/cmake/httplib/FindBrotli.cmake \
lib/cmake/httplib/httplibConfig.cmake \
@@ -34,4 +38,7 @@ BROTLI_RUN_DEPENDS= brotli>0:archivers/brotli
SSL_USES= ssl
SSL_CMAKE_BOOL= HTTPLIB_REQUIRE_OPENSSL HTTPLIB_USE_OPENSSL_IF_AVAILABLE
+do-test: install # 3 tests are known to fail: https://github.com/yhirose/cpp-httplib/issues/1028
+ @cd ${WRKSRC}/test && ${SETENV} ${MAKE_ENV} ${GMAKE} CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}"
+
.include <bsd.port.mk>
diff --git a/www/cpp-httplib/files/patch-test_Makefile b/www/cpp-httplib/files/patch-test_Makefile
new file mode 100644
index 000000000000..c818a121e196
--- /dev/null
+++ b/www/cpp-httplib/files/patch-test_Makefile
@@ -0,0 +1,26 @@
+--- test/Makefile.orig 2021-08-24 16:49:33 UTC
++++ test/Makefile
+@@ -1,5 +1,5 @@
+ #CXX = clang++
+-CXXFLAGS = -g -std=c++11 -I. -Wall -Wextra -Wtype-limits -Wconversion #-fsanitize=address
++CXXFLAGS += -g -std=c++11 -I. -Wall -Wextra -Wtype-limits -Wconversion #-fsanitize=address
+
+ OPENSSL_DIR = /usr/local/opt/openssl at 1.1
+ OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I$(OPENSSL_DIR)/include -L$(OPENSSL_DIR)/lib -lssl -lcrypto
+@@ -20,13 +20,13 @@ proxy : test_proxy
+ ./test_proxy
+
+ test : test.cc include_httplib.cc ../httplib.h Makefile cert.pem
+- $(CXX) -o $@ -I.. $(CXXFLAGS) test.cc include_httplib.cc $(TEST_ARGS)
++ $(CXX) -o $@ -I.. $(CXXFLAGS) test.cc include_httplib.cc ${LDFLAGS} $(TEST_ARGS)
+
+ test_split : test.cc ../httplib.h httplib.cc Makefile cert.pem
+- $(CXX) -o $@ $(CXXFLAGS) test.cc httplib.cc $(TEST_ARGS)
++ $(CXX) -o $@ $(CXXFLAGS) test.cc httplib.cc ${LDFLAGS} $(TEST_ARGS)
+
+ test_proxy : test_proxy.cc ../httplib.h Makefile cert.pem
+- $(CXX) -o $@ -I.. $(CXXFLAGS) test_proxy.cc $(TEST_ARGS)
++ $(CXX) -o $@ -I.. $(CXXFLAGS) test_proxy.cc ${LDFLAGS} $(TEST_ARGS)
+
+ httplib.cc : ../httplib.h
+ python3 ../split.py -o .
More information about the dev-commits-ports-all
mailing list