1 |
commit: 7d07fee32109260cfa3018c29a3a45d589a82d60 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Dec 31 09:09:34 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 31 09:09:34 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d07fee3 |
7 |
|
8 |
eclass/tests/python-utils-r1.sh: Remove obsoletep py2 usage |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
eclass/tests/python-utils-r1.sh | 46 ++++++++++------------------------------- |
13 |
1 file changed, 11 insertions(+), 35 deletions(-) |
14 |
|
15 |
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh |
16 |
index 1cd5cdbf6c0a..7ba4a864ff10 100755 |
17 |
--- a/eclass/tests/python-utils-r1.sh |
18 |
+++ b/eclass/tests/python-utils-r1.sh |
19 |
@@ -162,68 +162,44 @@ test_is "python_is_python3 pypy" 1 |
20 |
test_is "python_is_python3 pypy3" 0 |
21 |
|
22 |
# generic shebangs |
23 |
-test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7' |
24 |
test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6' |
25 |
test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3' |
26 |
|
27 |
# python2/python3 matching |
28 |
-test_fix_shebang '#!/usr/bin/python2' python2.7 '#!/usr/bin/python2.7' |
29 |
-test_fix_shebang '#!/usr/bin/python3' python2.7 FAIL |
30 |
-test_fix_shebang '#!/usr/bin/python3' python2.7 '#!/usr/bin/python2.7' --force |
31 |
test_fix_shebang '#!/usr/bin/python3' python3.6 '#!/usr/bin/python3.6' |
32 |
test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL |
33 |
test_fix_shebang '#!/usr/bin/python2' python3.6 '#!/usr/bin/python3.6' --force |
34 |
|
35 |
# pythonX.Y matching (those mostly test the patterns) |
36 |
-test_fix_shebang '#!/usr/bin/python2.7' python2.7 '#!/usr/bin/python2.7' |
37 |
test_fix_shebang '#!/usr/bin/python2.7' python3.2 FAIL |
38 |
test_fix_shebang '#!/usr/bin/python2.7' python3.2 '#!/usr/bin/python3.2' --force |
39 |
test_fix_shebang '#!/usr/bin/python3.2' python3.2 '#!/usr/bin/python3.2' |
40 |
-test_fix_shebang '#!/usr/bin/python3.2' python2.7 FAIL |
41 |
-test_fix_shebang '#!/usr/bin/python3.2' python2.7 '#!/usr/bin/python2.7' --force |
42 |
-test_fix_shebang '#!/usr/bin/pypy' python2.7 FAIL |
43 |
-test_fix_shebang '#!/usr/bin/pypy' python2.7 '#!/usr/bin/python2.7' --force |
44 |
|
45 |
# fancy path handling |
46 |
test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \ |
47 |
'#!/mnt/python2/usr/bin/python3.6' |
48 |
-test_fix_shebang '#!/mnt/python2/usr/bin/python2' python2.7 \ |
49 |
- '#!/mnt/python2/usr/bin/python2.7' |
50 |
-test_fix_shebang '#!/mnt/python2/usr/bin/env python' python2.7 \ |
51 |
- '#!/mnt/python2/usr/bin/env python2.7' |
52 |
-test_fix_shebang '#!/mnt/python2/usr/bin/python2 python2' python2.7 \ |
53 |
- '#!/mnt/python2/usr/bin/python2.7 python2' |
54 |
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python2' python2.7 FAIL |
55 |
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python2' python2.7 \ |
56 |
- '#!/mnt/python2/usr/bin/python2.7 python2' --force |
57 |
-test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL |
58 |
+test_fix_shebang '#!/mnt/python2/usr/bin/python3' python3.8 \ |
59 |
+ '#!/mnt/python2/usr/bin/python3.8' |
60 |
+test_fix_shebang '#!/mnt/python2/usr/bin/env python' python3.8 \ |
61 |
+ '#!/mnt/python2/usr/bin/env python3.8' |
62 |
+test_fix_shebang '#!/mnt/python2/usr/bin/python3 python3' python3.8 \ |
63 |
+ '#!/mnt/python2/usr/bin/python3.8 python3' |
64 |
+test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 FAIL |
65 |
+test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 \ |
66 |
+ '#!/mnt/python2/usr/bin/python3.8 python3' --force |
67 |
+test_fix_shebang '#!/usr/bin/foo' python3.8 FAIL |
68 |
|
69 |
# regression test for bug #522080 |
70 |
-test_fix_shebang '#!/usr/bin/python ' python2.7 '#!/usr/bin/python2.7 ' |
71 |
+test_fix_shebang '#!/usr/bin/python ' python3.8 '#!/usr/bin/python3.8 ' |
72 |
|
73 |
# check _python_impl_matches behavior |
74 |
-test_is "_python_impl_matches python2_7 -2" 0 |
75 |
-test_is "_python_impl_matches python3_6 -2" 1 |
76 |
-test_is "_python_impl_matches python3_7 -2" 1 |
77 |
-test_is "_python_impl_matches pypy3 -2" 1 |
78 |
-test_is "_python_impl_matches python2_7 -3" 1 |
79 |
test_is "_python_impl_matches python3_6 -3" 0 |
80 |
test_is "_python_impl_matches python3_7 -3" 0 |
81 |
test_is "_python_impl_matches pypy3 -3" 0 |
82 |
-test_is "_python_impl_matches python2_7 -2 python3_6" 0 |
83 |
-test_is "_python_impl_matches python3_6 -2 python3_6" 0 |
84 |
-test_is "_python_impl_matches python3_7 -2 python3_6" 1 |
85 |
-test_is "_python_impl_matches pypy3 -2 python3_6" 1 |
86 |
-test_is "_python_impl_matches python2_7 pypy3 -2 python3_6" 0 |
87 |
-test_is "_python_impl_matches python3_6 pypy3 -2 python3_6" 0 |
88 |
-test_is "_python_impl_matches python3_7 pypy3 -2 python3_6" 1 |
89 |
-test_is "_python_impl_matches pypy3 pypy3 -2 python3_6" 0 |
90 |
set -f |
91 |
-test_is "_python_impl_matches python2_7 pypy*" 1 |
92 |
test_is "_python_impl_matches python3_6 pypy*" 1 |
93 |
test_is "_python_impl_matches python3_7 pypy*" 1 |
94 |
test_is "_python_impl_matches pypy3 pypy*" 0 |
95 |
-test_is "_python_impl_matches python2_7 python*" 0 |
96 |
test_is "_python_impl_matches python3_6 python*" 0 |
97 |
test_is "_python_impl_matches python3_7 python*" 0 |
98 |
test_is "_python_impl_matches pypy3 python*" 1 |