From 18e6b74dc78e15968faf97a91d2f7d347c75b1a3 Mon Sep 17 00:00:00 2001 From: Ruslan Makhmatkhanov Date: Mon, 29 Oct 2012 21:20:53 +0000 Subject: [PATCH] - update minimum required py-meld3 version - use TEST_DEPENDS for tinderbox builds - add OPTIONS for unit tests - add regression-test target - add the upstream patch to fix tests [1] PR: 172851 Submitted by: Kubilay Kocak Approved by: Ildar Hizbulin (maintainer) [1] Feature safe: yes --- sysutils/py-supervisor/Makefile | 17 ++++++++++++++++- .../patch-supervisor-tests-test_childutils.py | 11 +++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 sysutils/py-supervisor/files/patch-supervisor-tests-test_childutils.py diff --git a/sysutils/py-supervisor/Makefile b/sysutils/py-supervisor/Makefile index 1a76ad24e356..58e8d31ddb6c 100644 --- a/sysutils/py-supervisor/Makefile +++ b/sysutils/py-supervisor/Makefile @@ -10,7 +10,19 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= hizel@vyborg.ru COMMENT= System to monitor and control a number of processes on UNIX-like OS -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}meld3>=0.6.4:${PORTSDIR}/www/py-meld3 +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}meld3>=0.6.5:${PORTSDIR}/www/py-meld3 +TEST_DEPENDS:= ${RUN_DEPENDS} \ + ${PYTHON_PKGNAMEPREFIX}mock>0:${PORTSDIR}/devel/py-mock + +OPTIONS_DEFINE= TESTS +TESTS_DESC= Install mock for running unit tests +OPTIONSFILE= ${PORT_DBDIR}/py-${PORTNAME}/options + +.include + +.if ${PORT_OPTIONS:MTESTS} +BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mock>0:${PORTSDIR}/devel/py-mock +.endif PORTDOCS= *.txt *.rst @@ -37,4 +49,7 @@ post-install: .endfor .endif +regression-test: build + @cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} test + .include diff --git a/sysutils/py-supervisor/files/patch-supervisor-tests-test_childutils.py b/sysutils/py-supervisor/files/patch-supervisor-tests-test_childutils.py new file mode 100644 index 000000000000..9d23a6c1c2c9 --- /dev/null +++ b/sysutils/py-supervisor/files/patch-supervisor-tests-test_childutils.py @@ -0,0 +1,11 @@ +--- supervisor/tests/test_childutils.py ++++ supervisor/tests/test_childutils.py +@@ -41,7 +41,7 @@ class ChildUtilsTests(unittest.TestCase): + + def test_get_asctime(self): + from supervisor.childutils import get_asctime +- timestamp = time.mktime((2009, 1, 18, 22, 14, 7, 0, 0, 0)) ++ timestamp = time.mktime((2009, 1, 18, 22, 14, 7, 0, 0, -1)) + result = get_asctime(timestamp) + self.assertEqual(result, '2009-01-18 22:14:07,000') +