changeset 205:31261c452c90

pypy311: make test execution work ("make test")
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 13 Mar 2025 21:06:09 +0100
parents 0b0312cdf0ca
children 7f8d6a19c404
files lang/pypy311/Makefile lang/pypy311/files/patch-pypy_pytest-A.cfg
diffstat 2 files changed, 26 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lang/pypy311/Makefile	Thu Mar 13 20:19:50 2025 +0100
+++ b/lang/pypy311/Makefile	Thu Mar 13 21:06:09 2025 +0100
@@ -51,12 +51,17 @@
 BCCHECKEDHASH_DESC=	Use checked hash based .pyc file invalidataion
 BCUNCHECKEDHASH_DESC=	Use unchecked hash based .pyc file invalidataion
 
+PYTHON_USES=		python:2.7,build,test
 PYTHON_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:devel/py-pycparser@${PY_FLAVOR}
-PYTHON_USES=	python:2.7,build
+PYTHON_VARS=		TESTRUNNER_PYTHON_CMD=${LOCALBASE}/bin/python2.7
+PYPY_USES=		python:2.7,test
 PYPY_BUILD_DEPENDS=	pypy2:lang/pypy2
-PYPY_VARS=	PYTHON_CMD=${LOCALBASE}/bin/pypy
+PYPY_VARS=		PYTHON_CMD=${LOCALBASE}/bin/pypy \
+			TESTRUNNER_PYTHON_CMD=${LOCALBASE}/bin/python2.7
+PYPY_MINMEM_USES=		python:2.7,test
 PYPY_MINMEM_BUILD_DEPENDS=	pypy2:lang/pypy2
-PYPY_MINMEM_VARS=	PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300"
+PYPY_MINMEM_VARS=		PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300" \
+				TESTRUNNER_PYTHON_CMD=${LOCALBASE}/bin/python2.7
 BCTIMESTAMP_VARS=	COMPILEALL_INVALIDATIONMODE=timestamp
 BCCHECKEDHASH_VARS=	COMPILEALL_INVALIDATIONMODE=checked-hash
 BCUNCHECKEDHASH_VARS=	COMPILEALL_INVALIDATIONMODE=unchecked-hash
@@ -187,16 +192,16 @@
 	# add_translated_tests()
 	(cd ${WRKSRC}; \
 		${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
-		${WRKSRC}/pypy/goal/${PYPY_EXECUTABLE} testrunner/runner.py --root pypy --logfile=pytest-A.log \
+		${TESTRUNNER_PYTHON_CMD} testrunner/runner.py --root pypy --logfile=pytest-A.log \
 			--parallel-runs ${MAKE_JOBS_NUMBER} \
 			--config pypy/pytest-A.cfg --config pypy/pytest-A.py)
 .for dir in lib-python pypy/module/pypyjit/test
 	(cd ${WRKSRC}; \
 		${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
-		${WRKSRC}/pypy/goal/${PYPY_EXECUTABLE} pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/${PYPY_EXECUTABLE} \
+		${TESTRUNNER_PYTHON_CMD} pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/${PYPY_EXECUTABLE} \
 			${dir} )
 .endfor
-	(cd ${WRKSRC}/lib-python/2.7/test; \
+	(cd ${WRKSRC}/lib-python/3/test; \
 		${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
 		${WRKSRC}/pypy/goal/${PYPY_EXECUTABLE} regrtest.py -vvu all)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pypy311/files/patch-pypy_pytest-A.cfg	Thu Mar 13 21:06:09 2025 +0100
@@ -0,0 +1,15 @@
+--- pypy/pytest-A.cfg.orig	2025-02-24 17:28:26 UTC
++++ pypy/pytest-A.cfg
+@@ -4,7 +4,11 @@ cherrypick = ['interpreter', 'objspace/test', 'objspac
+ 
+ cherrypick = ['interpreter', 'objspace/test', 'objspace/std', 'module']
+ 
+-interp = ['python']
++#
++# fag: There is no Python 2.7 available on FreeBSD that is called "python":
++#      use python2.7 instead
++#interp = ['python']
++interp = ['python2.7']
+ test_driver = ['test_all.py', '-A', '--python',
+     # Get the target_path pypy/goal/pypyd.d.exe from testrunner/get_info.py
+     json.loads(subprocess.check_output([sys.executable, 'testrunner/get_info.py']))['target_path'], ]