git: 408432c44035 - main - devel/cxxtest: support self-tests and add py-ply to depends

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Sat, 22 Jul 2023 17:37:43 UTC
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=408432c44035b0350dd1ddf0ebe6639e11582f27

commit 408432c44035b0350dd1ddf0ebe6639e11582f27
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2023-07-22 17:34:37 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2023-07-22 17:35:44 +0000

    devel/cxxtest: support self-tests and add py-ply to depends
---
 devel/cxxtest/Makefile                   | 18 ++++++++++++++++--
 devel/cxxtest/files/patch-remove--Werror | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/devel/cxxtest/Makefile b/devel/cxxtest/Makefile
index 648fb2d87279..0a15ba484717 100644
--- a/devel/cxxtest/Makefile
+++ b/devel/cxxtest/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	cxxtest
 PORTVERSION=	4.4
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel
 MASTER_SITES=	SF:DEFAULT \
 		https://github.com/CxxTest/cxxtest.github.com/raw/8505a9c37bdf17d9167f0b946c82ccb032d3cd4c/:docs
@@ -16,9 +16,13 @@ WWW=		https://github.com/CxxTest/cxxtest
 
 LICENSE=	LGPL3+
 
-USES=		gmake python:run
+USES=		gmake python
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}ply>=0:devel/py-ply@${PY_FLAVOR}
+BUILD_DEPENDS=	${RUN_DEPENDS}
 
 USE_PYTHON=	autoplist distutils noflavors
+BINARY_ALIAS=	c++=${CXX} cl=${FALSE} clang++=${FALSE} g++=${FALSE}
 NO_ARCH=	yes
 
 WRKSRC_SUBDIR=		python
@@ -44,4 +48,14 @@ post-install-EXAMPLES-on:
 	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 	( cd ${WRKSRC}/../sample/ && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} )
 
+do-test:
+	( set -x \
+		&& cd ${WRKSRC}/../test \
+		&& ${RM} -R test_cxxtest \
+		&& ${PYTHON_CMD} -m venv test_cxxtest --system-site-packages --without-pip \
+		&& . test_cxxtest/bin/activate \
+		&& ( cd ../python && ${PYTHON_CMD} setup.py install --prefix "$$VIRTUAL_ENV" ) \
+		&& ${SETENV} "PATH=${PATH}" ${PYTHON_CMD} test_cxxtest.py --verbose \
+	)
+
 .include <bsd.port.mk>
diff --git a/devel/cxxtest/files/patch-remove--Werror b/devel/cxxtest/files/patch-remove--Werror
new file mode 100644
index 000000000000..9bffb04bae5c
--- /dev/null
+++ b/devel/cxxtest/files/patch-remove--Werror
@@ -0,0 +1,21 @@
+diff -up work/cxxtest-4.4/test/test_cxxtest.py.orig work/cxxtest-4.4/test/test_cxxtest.py
+--- ../test/test_cxxtest.py.orig	2014-06-04 05:57:07.000000000 +0200
++++ ../test/test_cxxtest.py	2023-07-22 17:40:33.232336000 +0200
+@@ -749,7 +749,7 @@ class TestCpp(BaseTestCase, unittest.TestCase):
+     # Compiler specifics
+     exe_option = '-o'
+     include_option = '-I'
+-    compiler='c++ -Wall -W -Werror -g'
++    compiler='c++ -Wall -W -g'
+     no_eh_option = None
+     qtFlags='-Ifake'
+     x11Flags='-Ifake'
+@@ -780,7 +780,7 @@ class TestGpp(BaseTestCase, unittest.TestCase):
+     # Compiler specifics
+     exe_option = '-o'
+     include_option = '-I'
+-    compiler='g++ -g -ansi -pedantic -Wmissing-declarations -Werror -Wall -W -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wreorder -Wsign-promo %s' % os.environ.get('CXXTEST_GCOV_FLAGS','')
++    compiler='g++ -g -ansi -pedantic -Wmissing-declarations -Wall -W -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wreorder -Wsign-promo %s' % os.environ.get('CXXTEST_GCOV_FLAGS','')
+     no_eh_option = '-fno-exceptions'
+     qtFlags='-Ifake'
+     x11Flags='-Ifake'