summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xeclass/tests/python-utils-r1.sh46
1 files changed, 11 insertions, 35 deletions
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 1cd5cdbf6c0a..7ba4a864ff10 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -162,68 +162,44 @@ test_is "python_is_python3 pypy" 1
test_is "python_is_python3 pypy3" 0
# generic shebangs
-test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7'
test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6'
test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
# python2/python3 matching
-test_fix_shebang '#!/usr/bin/python2' python2.7 '#!/usr/bin/python2.7'
-test_fix_shebang '#!/usr/bin/python3' python2.7 FAIL
-test_fix_shebang '#!/usr/bin/python3' python2.7 '#!/usr/bin/python2.7' --force
test_fix_shebang '#!/usr/bin/python3' python3.6 '#!/usr/bin/python3.6'
test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL
test_fix_shebang '#!/usr/bin/python2' python3.6 '#!/usr/bin/python3.6' --force
# pythonX.Y matching (those mostly test the patterns)
-test_fix_shebang '#!/usr/bin/python2.7' python2.7 '#!/usr/bin/python2.7'
test_fix_shebang '#!/usr/bin/python2.7' python3.2 FAIL
test_fix_shebang '#!/usr/bin/python2.7' python3.2 '#!/usr/bin/python3.2' --force
test_fix_shebang '#!/usr/bin/python3.2' python3.2 '#!/usr/bin/python3.2'
-test_fix_shebang '#!/usr/bin/python3.2' python2.7 FAIL
-test_fix_shebang '#!/usr/bin/python3.2' python2.7 '#!/usr/bin/python2.7' --force
-test_fix_shebang '#!/usr/bin/pypy' python2.7 FAIL
-test_fix_shebang '#!/usr/bin/pypy' python2.7 '#!/usr/bin/python2.7' --force
# fancy path handling
test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
'#!/mnt/python2/usr/bin/python3.6'
-test_fix_shebang '#!/mnt/python2/usr/bin/python2' python2.7 \
- '#!/mnt/python2/usr/bin/python2.7'
-test_fix_shebang '#!/mnt/python2/usr/bin/env python' python2.7 \
- '#!/mnt/python2/usr/bin/env python2.7'
-test_fix_shebang '#!/mnt/python2/usr/bin/python2 python2' python2.7 \
- '#!/mnt/python2/usr/bin/python2.7 python2'
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python2' python2.7 FAIL
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python2' python2.7 \
- '#!/mnt/python2/usr/bin/python2.7 python2' --force
-test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL
+test_fix_shebang '#!/mnt/python2/usr/bin/python3' python3.8 \
+ '#!/mnt/python2/usr/bin/python3.8'
+test_fix_shebang '#!/mnt/python2/usr/bin/env python' python3.8 \
+ '#!/mnt/python2/usr/bin/env python3.8'
+test_fix_shebang '#!/mnt/python2/usr/bin/python3 python3' python3.8 \
+ '#!/mnt/python2/usr/bin/python3.8 python3'
+test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 FAIL
+test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 \
+ '#!/mnt/python2/usr/bin/python3.8 python3' --force
+test_fix_shebang '#!/usr/bin/foo' python3.8 FAIL
# regression test for bug #522080
-test_fix_shebang '#!/usr/bin/python ' python2.7 '#!/usr/bin/python2.7 '
+test_fix_shebang '#!/usr/bin/python ' python3.8 '#!/usr/bin/python3.8 '
# check _python_impl_matches behavior
-test_is "_python_impl_matches python2_7 -2" 0
-test_is "_python_impl_matches python3_6 -2" 1
-test_is "_python_impl_matches python3_7 -2" 1
-test_is "_python_impl_matches pypy3 -2" 1
-test_is "_python_impl_matches python2_7 -3" 1
test_is "_python_impl_matches python3_6 -3" 0
test_is "_python_impl_matches python3_7 -3" 0
test_is "_python_impl_matches pypy3 -3" 0
-test_is "_python_impl_matches python2_7 -2 python3_6" 0
-test_is "_python_impl_matches python3_6 -2 python3_6" 0
-test_is "_python_impl_matches python3_7 -2 python3_6" 1
-test_is "_python_impl_matches pypy3 -2 python3_6" 1
-test_is "_python_impl_matches python2_7 pypy3 -2 python3_6" 0
-test_is "_python_impl_matches python3_6 pypy3 -2 python3_6" 0
-test_is "_python_impl_matches python3_7 pypy3 -2 python3_6" 1
-test_is "_python_impl_matches pypy3 pypy3 -2 python3_6" 0
set -f
-test_is "_python_impl_matches python2_7 pypy*" 1
test_is "_python_impl_matches python3_6 pypy*" 1
test_is "_python_impl_matches python3_7 pypy*" 1
test_is "_python_impl_matches pypy3 pypy*" 0
-test_is "_python_impl_matches python2_7 python*" 0
test_is "_python_impl_matches python3_6 python*" 0
test_is "_python_impl_matches python3_7 python*" 0
test_is "_python_impl_matches pypy3 python*" 1