summaryrefslogtreecommitdiff
blob: ff98d83f2984c6acab6a684c277f6f60a1e0921a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/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 PYTHON_SCRIPTDIR python2_7 /usr/lib/python-exec/python2.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 PYTHON_SCRIPTDIR python3_3 /usr/lib/python-exec/python3.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 PYTHON_SCRIPTDIR jython2_7 /usr/lib/python-exec/jython2.7

test_var EPYTHON pypy pypy
test_var PYTHON pypy /usr/bin/pypy
test_var PYTHON_SITEDIR pypy /usr/lib/pypy/site-packages
test_var PYTHON_INCLUDEDIR pypy /usr/lib/pypy/include
test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0='
test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy

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 pypy 1

texit