1 |
--- |
2 |
gx86/eclass/tests/python-utils-r1.sh | 80 ++++++++++++++++++++++++++++++++++++ |
3 |
1 file changed, 80 insertions(+) |
4 |
create mode 100755 gx86/eclass/tests/python-utils-r1.sh |
5 |
|
6 |
diff --git a/gx86/eclass/tests/python-utils-r1.sh b/gx86/eclass/tests/python-utils-r1.sh |
7 |
new file mode 100755 |
8 |
index 0000000..e0378da |
9 |
--- /dev/null |
10 |
+++ b/gx86/eclass/tests/python-utils-r1.sh |
11 |
@@ -0,0 +1,80 @@ |
12 |
+#!/bin/bash |
13 |
+ |
14 |
+EAPI=5 |
15 |
+source tests-common.sh |
16 |
+ |
17 |
+test_var() { |
18 |
+ local var=${1} |
19 |
+ local impl=${2} |
20 |
+ local expect=${3} |
21 |
+ |
22 |
+ tbegin "${var} for ${impl}" |
23 |
+ |
24 |
+ local ${var} |
25 |
+ python_export ${impl} ${var} |
26 |
+ [[ ${!var} == ${expect} ]] || eerror "(${impl}: ${var}: ${!var} != ${expect}" |
27 |
+ |
28 |
+ tend ${?} |
29 |
+} |
30 |
+ |
31 |
+test_is() { |
32 |
+ local func=${1} |
33 |
+ local EPYTHON=${2} |
34 |
+ local expect=${3} |
35 |
+ |
36 |
+ tbegin "${func} for ${EPYTHON} (expecting: ${3})" |
37 |
+ |
38 |
+ ${func} |
39 |
+ [[ ${?} == ${expect} ]] |
40 |
+ |
41 |
+ tend ${?} |
42 |
+} |
43 |
+ |
44 |
+inherit python-utils-r1 |
45 |
+ |
46 |
+test_var EPYTHON python2_7 python2.7 |
47 |
+test_var PYTHON python2_7 /usr/bin/python2.7 |
48 |
+test_var PYTHON_SITEDIR python2_7 /usr/lib/python2.7/site-packages |
49 |
+test_var PYTHON_INCLUDEDIR python2_7 /usr/include/python2.7 |
50 |
+test_var PYTHON_LIBPATH python2_7 /usr/lib/libpython2.7$(get_libname) |
51 |
+test_var PYTHON_PKG_DEP python2_7 dev-lang/python:2.7 |
52 |
+ |
53 |
+test_var EPYTHON python3_3 python3.3 |
54 |
+test_var PYTHON python3_3 /usr/bin/python3.3 |
55 |
+test_var PYTHON_SITEDIR python3_3 /usr/lib/python3.3/site-packages |
56 |
+test_var PYTHON_INCLUDEDIR python3_3 /usr/include/python3.3 |
57 |
+test_var PYTHON_LIBPATH python3_3 /usr/lib/libpython3.3$(get_libname) |
58 |
+test_var PYTHON_PKG_DEP python3_3 dev-lang/python:3.3 |
59 |
+ |
60 |
+test_var EPYTHON jython2_7 jython2.7 |
61 |
+test_var PYTHON jython2_7 /usr/bin/jython2.7 |
62 |
+test_var PYTHON_SITEDIR jython2_7 /usr/share/jython2.7/Lib/site-packages |
63 |
+test_var PYTHON_INCLUDEDIR jython2_7 /usr/share/jython2.7/Include |
64 |
+test_var PYTHON_PKG_DEP jython2_7 dev-java/jython:2.7 |
65 |
+ |
66 |
+test_var EPYTHON pypy2_0 pypy-c2.0 |
67 |
+test_var PYTHON pypy2_0 /usr/bin/pypy-c2.0 |
68 |
+test_var PYTHON_SITEDIR pypy2_0 /usr/lib/pypy2.0/site-packages |
69 |
+test_var PYTHON_INCLUDEDIR pypy2_0 /usr/lib/pypy2.0/include |
70 |
+test_var PYTHON_PKG_DEP pypy2_0 virtual/pypy:2.0 |
71 |
+ |
72 |
+test_var EPYTHON pypy-2_1 pypy-2.1 |
73 |
+test_var PYTHON pypy-2_1 /usr/bin/pypy-2.1 |
74 |
+test_var PYTHON_SITEDIR pypy-2_1 /usr/lib/pypy-2.1/site-packages |
75 |
+test_var PYTHON_INCLUDEDIR pypy-2_1 /usr/lib/pypy-2.1/include |
76 |
+test_var PYTHON_PKG_DEP pypy-2_1 virtual/pypy:2.1 |
77 |
+ |
78 |
+test_var EPYTHON pypy3-2_1 pypy3-2.1 |
79 |
+test_var PYTHON pypy3-2_1 /usr/bin/pypy3-2.1 |
80 |
+test_var PYTHON_SITEDIR pypy3-2_1 /usr/lib/pypy3-2.1/site-packages |
81 |
+test_var PYTHON_INCLUDEDIR pypy3-2_1 /usr/lib/pypy3-2.1/include |
82 |
+test_var PYTHON_PKG_DEP pypy3-2_1 virtual/pypy3:2.1 |
83 |
+ |
84 |
+test_is python_is_python3 python2.7 1 |
85 |
+test_is python_is_python3 python3.2 0 |
86 |
+test_is python_is_python3 jython2.7 1 |
87 |
+test_is python_is_python3 pypy2.0 1 |
88 |
+test_is python_is_python3 pypy-2.1 1 |
89 |
+test_is python_is_python3 pypy3-2.1 0 |
90 |
+ |
91 |
+texit |
92 |
-- |
93 |
1.8.3.2 |