From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 75874138334 for ; Wed, 20 Nov 2019 07:47:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B4829E0863; Wed, 20 Nov 2019 07:47:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 82B84E0814 for ; Wed, 20 Nov 2019 07:47:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6F172335C9A for ; Wed, 20 Nov 2019 07:47:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A2E0F8B7 for ; Wed, 20 Nov 2019 07:47:13 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1574235844.dab1b0137f4fd5f91dab6dafe8a4c130a28290f3.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/tests/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/tests/distutils-r1.sh X-VCS-Directories: eclass/tests/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: dab1b0137f4fd5f91dab6dafe8a4c130a28290f3 X-VCS-Branch: master Date: Wed, 20 Nov 2019 07:47:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 03e1eb62-329e-46da-9930-fa857138d93f X-Archives-Hash: f5fcaf1c27213caf66b496cbccc71f29 commit: dab1b0137f4fd5f91dab6dafe8a4c130a28290f3 Author: Michał Górny gentoo org> AuthorDate: Fri Nov 15 16:34:45 2019 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Nov 20 07:44:04 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dab1b013 distutils-r1.eclass: Add tests for distutils_enable_tests Signed-off-by: Michał Górny gentoo.org> eclass/tests/distutils-r1.sh | 67 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh index d557f6cad53..d5f3e2812ca 100755 --- a/eclass/tests/distutils-r1.sh +++ b/eclass/tests/distutils-r1.sh @@ -17,6 +17,36 @@ test-phase_name_free() { fi } +test-distutils_enable_tests() { + local runner=${1} + local exp_IUSE=${2} + local exp_RESTRICT=${3} + local exp_DEPEND=${4} + + local IUSE=${IUSE} + local RESTRICT=${RESTRICT} + local DEPEND=${DEPEND} + + tbegin "${runner}" + + distutils_enable_tests "${runner}" + + local ret var + for var in IUSE RESTRICT DEPEND; do + local exp_var=exp_${var} + if [[ ${!var} != "${!exp_var}" ]]; then + eindent + eerror "${var} expected: ${!exp_var}" + eerror "${var} actual: ${!var}" + eoutdent + ret=1 + tret=1 + fi + done + + tend ${ret} +} + inherit distutils-r1 tbegin "sane function names" @@ -27,6 +57,41 @@ test-phase_name_free python_compile test-phase_name_free python_test test-phase_name_free python_install -tend ${failed} +tend + +einfo distutils_enable_tests +eindent +BASE_IUSE="python_targets_python2_7" +BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]" +TEST_RESTRICT=" !test? ( test )" + +einfo "empty RDEPEND" +eindent +RDEPEND="" +test-distutils_enable_tests pytest \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] )" +test-distutils_enable_tests nose \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] )" +test-distutils_enable_tests unittest \ + "${BASE_IUSE}" "" "${BASE_DEPS}" +test-distutils_enable_tests setup.py \ + "${BASE_IUSE}" "" "${BASE_DEPS}" +eoutdent + +einfo "non-empty RDEPEND" +eindent +BASE_RDEPEND="dev-python/foo[${PYTHON_USEDEP}]" +RDEPEND=${BASE_RDEPEND} +test-distutils_enable_tests pytest \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] ${BASE_RDEPEND} )" +test-distutils_enable_tests nose \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] ${BASE_RDEPEND} )" +test-distutils_enable_tests unittest \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )" +test-distutils_enable_tests setup.py \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )" +eoutdent + +eoutdent texit