diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-09-08 14:53:55 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-09-08 14:53:55 +0000 |
commit | f9fb313042e23a459b9441f47e0cc42472e98ffc (patch) | |
tree | 5abc1deb8fb457cfb6ad5498453321fe764656f5 /eclass/tests/python-utils-r1.sh | |
parent | revbump -EAPI 5, add invocation of tests (diff) | |
download | historical-f9fb313042e23a459b9441f47e0cc42472e98ffc.tar.gz historical-f9fb313042e23a459b9441f47e0cc42472e98ffc.tar.bz2 historical-f9fb313042e23a459b9441f47e0cc42472e98ffc.zip |
Introduce tests for python-utils-r1.
Diffstat (limited to 'eclass/tests/python-utils-r1.sh')
-rwxr-xr-x | eclass/tests/python-utils-r1.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh new file mode 100755 index 000000000000..d4f8dae96d43 --- /dev/null +++ b/eclass/tests/python-utils-r1.sh @@ -0,0 +1,65 @@ +#!/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/jython-2.7/Lib/site-packages +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_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 + +texit |