1 |
mgorny 14/07/06 17:13:14 |
2 |
|
3 |
Modified: python-utils-r1.sh |
4 |
Log: |
5 |
Add tests for _python_impl_supported. |
6 |
|
7 |
Revision Changes Path |
8 |
1.8 eclass/tests/python-utils-r1.sh |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.8&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.8&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.7&r2=1.8 |
13 |
|
14 |
Index: python-utils-r1.sh |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v |
17 |
retrieving revision 1.7 |
18 |
retrieving revision 1.8 |
19 |
diff -u -r1.7 -r1.8 |
20 |
--- python-utils-r1.sh 19 Jun 2014 08:08:10 -0000 1.7 |
21 |
+++ python-utils-r1.sh 6 Jul 2014 17:13:14 -0000 1.8 |
22 |
@@ -19,10 +19,9 @@ |
23 |
|
24 |
test_is() { |
25 |
local func=${1} |
26 |
- local EPYTHON=${2} |
27 |
- local expect=${3} |
28 |
+ local expect=${2} |
29 |
|
30 |
- tbegin "${func} for ${EPYTHON} (expecting: ${3})" |
31 |
+ tbegin "${func} (expecting: ${expect})" |
32 |
|
33 |
${func} |
34 |
[[ ${?} == ${expect} ]] |
35 |
@@ -88,10 +87,10 @@ |
36 |
test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0=' |
37 |
test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy |
38 |
|
39 |
-test_is python_is_python3 python2.7 1 |
40 |
-test_is python_is_python3 python3.2 0 |
41 |
-test_is python_is_python3 jython2.7 1 |
42 |
-test_is python_is_python3 pypy 1 |
43 |
+test_is "EPYTHON=python2.7 python_is_python3" 1 |
44 |
+test_is "EPYTHON=python3.2 python_is_python3" 0 |
45 |
+test_is "EPYTHON=jython2.7 python_is_python3" 1 |
46 |
+test_is "EPYTHON=pypy python_is_python3" 1 |
47 |
|
48 |
# generic shebangs |
49 |
test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7' |
50 |
@@ -135,6 +134,21 @@ |
51 |
'#!/mnt/python2/usr/bin/python2.7 python2' --force |
52 |
test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL |
53 |
|
54 |
+# make sure we don't break pattern matching |
55 |
+test_is "_python_impl_supported python2_5" 1 |
56 |
+test_is "_python_impl_supported python2_6" 1 |
57 |
+test_is "_python_impl_supported python2_7" 0 |
58 |
+test_is "_python_impl_supported python3_1" 1 |
59 |
+test_is "_python_impl_supported python3_2" 0 |
60 |
+test_is "_python_impl_supported python3_3" 0 |
61 |
+test_is "_python_impl_supported python3_4" 0 |
62 |
+test_is "_python_impl_supported pypy1_8" 1 |
63 |
+test_is "_python_impl_supported pypy1_9" 1 |
64 |
+test_is "_python_impl_supported pypy2_0" 1 |
65 |
+test_is "_python_impl_supported pypy" 0 |
66 |
+test_is "_python_impl_supported jython2_5" 0 |
67 |
+test_is "_python_impl_supported jython2_7" 0 |
68 |
+ |
69 |
rm "${tmpfile}" |
70 |
|
71 |
texit |