From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4C1A41381F3 for ; Thu, 22 Aug 2013 07:46:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2FEF0E081D; Thu, 22 Aug 2013 07:46:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 51CA5E081D for ; Thu, 22 Aug 2013 07:46:48 +0000 (UTC) Received: from pomiot.lan (77-254-183-247.adsl.inetia.pl [77.254.183.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 742E833EBC1; Thu, 22 Aug 2013 07:46:46 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-python@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-python] [PATCH python-utils-r1] Add some tests for query functions. Date: Thu, 22 Aug 2013 09:46:43 +0200 Message-Id: <1377157603-3146-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <20130821215352.3ba7a2af@gentoo.org> References: <20130821215352.3ba7a2af@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org X-Archives-Salt: d19eda25-a78e-47ea-8c48-691ec118fdf8 X-Archives-Hash: 05996ac3ec75bc16f91e0dd8e4a00989 --- gx86/eclass/tests/python-utils-r1.sh | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 gx86/eclass/tests/python-utils-r1.sh diff --git a/gx86/eclass/tests/python-utils-r1.sh b/gx86/eclass/tests/python-utils-r1.sh new file mode 100755 index 0000000..e0378da --- /dev/null +++ b/gx86/eclass/tests/python-utils-r1.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +EAPI=5 +source tests-common.sh + +test_var() { + local var=${1} + local impl=${2} + local expect=${3} + + tbegin "${var} for ${impl}" + + local ${var} + python_export ${impl} ${var} + [[ ${!var} == ${expect} ]] || eerror "(${impl}: ${var}: ${!var} != ${expect}" + + tend ${?} +} + +test_is() { + local func=${1} + local EPYTHON=${2} + local expect=${3} + + tbegin "${func} for ${EPYTHON} (expecting: ${3})" + + ${func} + [[ ${?} == ${expect} ]] + + tend ${?} +} + +inherit python-utils-r1 + +test_var EPYTHON python2_7 python2.7 +test_var PYTHON python2_7 /usr/bin/python2.7 +test_var PYTHON_SITEDIR python2_7 /usr/lib/python2.7/site-packages +test_var PYTHON_INCLUDEDIR python2_7 /usr/include/python2.7 +test_var PYTHON_LIBPATH python2_7 /usr/lib/libpython2.7$(get_libname) +test_var PYTHON_PKG_DEP python2_7 dev-lang/python:2.7 + +test_var EPYTHON python3_3 python3.3 +test_var PYTHON python3_3 /usr/bin/python3.3 +test_var PYTHON_SITEDIR python3_3 /usr/lib/python3.3/site-packages +test_var PYTHON_INCLUDEDIR python3_3 /usr/include/python3.3 +test_var PYTHON_LIBPATH python3_3 /usr/lib/libpython3.3$(get_libname) +test_var PYTHON_PKG_DEP python3_3 dev-lang/python:3.3 + +test_var EPYTHON jython2_7 jython2.7 +test_var PYTHON jython2_7 /usr/bin/jython2.7 +test_var PYTHON_SITEDIR jython2_7 /usr/share/jython2.7/Lib/site-packages +test_var PYTHON_INCLUDEDIR jython2_7 /usr/share/jython2.7/Include +test_var PYTHON_PKG_DEP jython2_7 dev-java/jython:2.7 + +test_var EPYTHON pypy2_0 pypy-c2.0 +test_var PYTHON pypy2_0 /usr/bin/pypy-c2.0 +test_var PYTHON_SITEDIR pypy2_0 /usr/lib/pypy2.0/site-packages +test_var PYTHON_INCLUDEDIR pypy2_0 /usr/lib/pypy2.0/include +test_var PYTHON_PKG_DEP pypy2_0 virtual/pypy:2.0 + +test_var EPYTHON pypy-2_1 pypy-2.1 +test_var PYTHON pypy-2_1 /usr/bin/pypy-2.1 +test_var PYTHON_SITEDIR pypy-2_1 /usr/lib/pypy-2.1/site-packages +test_var PYTHON_INCLUDEDIR pypy-2_1 /usr/lib/pypy-2.1/include +test_var PYTHON_PKG_DEP pypy-2_1 virtual/pypy:2.1 + +test_var EPYTHON pypy3-2_1 pypy3-2.1 +test_var PYTHON pypy3-2_1 /usr/bin/pypy3-2.1 +test_var PYTHON_SITEDIR pypy3-2_1 /usr/lib/pypy3-2.1/site-packages +test_var PYTHON_INCLUDEDIR pypy3-2_1 /usr/lib/pypy3-2.1/include +test_var PYTHON_PKG_DEP pypy3-2_1 virtual/pypy3:2.1 + +test_is python_is_python3 python2.7 1 +test_is python_is_python3 python3.2 0 +test_is python_is_python3 jython2.7 1 +test_is python_is_python3 pypy2.0 1 +test_is python_is_python3 pypy-2.1 1 +test_is python_is_python3 pypy3-2.1 0 + +texit -- 1.8.3.2