[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/12/21 14:30:08 Modified: python-utils-r1.sh Log: Update tests for unsupported python3.2. Revision ChangesPath 1.12 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.12view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.12content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.11r2=1.12 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- python-utils-r1.sh 5 Nov 2014 23:03:01 - 1.11 +++ python-utils-r1.sh 21 Dec 2014 14:30:08 - 1.12 @@ -151,7 +151,7 @@ test_is _python_impl_supported python2_6 1 test_is _python_impl_supported python2_7 0 test_is _python_impl_supported python3_1 1 -test_is _python_impl_supported python3_2 0 +test_is _python_impl_supported python3_2 1 test_is _python_impl_supported python3_3 0 test_is _python_impl_supported python3_4 0 test_is _python_impl_supported pypy1_8 1
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/11/05 23:03:01 Modified: python-utils-r1.sh Log: Add support for PyPy3. Revision ChangesPath 1.11 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.11view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.11content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.10r2=1.11 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- python-utils-r1.sh 4 Sep 2014 14:52:58 - 1.10 +++ python-utils-r1.sh 5 Nov 2014 23:03:01 - 1.11 @@ -87,15 +87,24 @@ test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0=' test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy +test_var EPYTHON pypy3 pypy3 +test_var PYTHON pypy3 /usr/bin/pypy3 +test_var PYTHON_SITEDIR pypy3 /usr/lib/pypy3/site-packages +test_var PYTHON_INCLUDEDIR pypy3 /usr/lib/pypy3/include +test_var PYTHON_PKG_DEP pypy3 '*virtual/pypy3*:0=' +test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3 + 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 +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.4 '#!/usr/bin/python3.4' test_fix_shebang '#!/usr/bin/python' pypy '#!/usr/bin/pypy' +test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3' test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7' # python2/python3 matching @@ -149,6 +158,7 @@ test_is _python_impl_supported pypy1_9 1 test_is _python_impl_supported pypy2_0 1 test_is _python_impl_supported pypy 0 +test_is _python_impl_supported pypy3 0 test_is _python_impl_supported jython2_5 0 test_is _python_impl_supported jython2_7 0
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/09/04 14:00:43 Modified: python-utils-r1.sh Log: Fix tests for python_is_python3. Revision ChangesPath 1.9 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.9view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.9content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.8r2=1.9 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- python-utils-r1.sh 6 Jul 2014 17:13:14 - 1.8 +++ python-utils-r1.sh 4 Sep 2014 14:00:43 - 1.9 @@ -87,10 +87,10 @@ test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0=' test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy -test_is EPYTHON=python2.7 python_is_python3 1 -test_is EPYTHON=python3.2 python_is_python3 0 -test_is EPYTHON=jython2.7 python_is_python3 1 -test_is EPYTHON=pypy python_is_python3 1 +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 # generic shebangs test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7'
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/09/04 14:52:58 Modified: python-utils-r1.sh Log: Preserve all whitespace in shebangs, and add regression test for that. Also, prevent filename expansion when word-splitting it. Bug #522080. Revision ChangesPath 1.10 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.10view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.10content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.9r2=1.10 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- python-utils-r1.sh 4 Sep 2014 14:00:43 - 1.9 +++ python-utils-r1.sh 4 Sep 2014 14:52:58 - 1.10 @@ -134,6 +134,9 @@ '#!/mnt/python2/usr/bin/python2.7 python2' --force test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL +# regression test for bug #522080 +test_fix_shebang '#!/usr/bin/python ' python2.7 '#!/usr/bin/python2.7 ' + # make sure we don't break pattern matching test_is _python_impl_supported python2_5 1 test_is _python_impl_supported python2_6 1
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/07/06 17:13:14 Modified: python-utils-r1.sh Log: Add tests for _python_impl_supported. Revision ChangesPath 1.8 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.8view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.8content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.7r2=1.8 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- python-utils-r1.sh 19 Jun 2014 08:08:10 - 1.7 +++ python-utils-r1.sh 6 Jul 2014 17:13:14 - 1.8 @@ -19,10 +19,9 @@ test_is() { local func=${1} - local EPYTHON=${2} - local expect=${3} + local expect=${2} - tbegin ${func} for ${EPYTHON} (expecting: ${3}) + tbegin ${func} (expecting: ${expect}) ${func} [[ ${?} == ${expect} ]] @@ -88,10 +87,10 @@ 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 +test_is EPYTHON=python2.7 python_is_python3 1 +test_is EPYTHON=python3.2 python_is_python3 0 +test_is EPYTHON=jython2.7 python_is_python3 1 +test_is EPYTHON=pypy python_is_python3 1 # generic shebangs test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7' @@ -135,6 +134,21 @@ '#!/mnt/python2/usr/bin/python2.7 python2' --force test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL +# make sure we don't break pattern matching +test_is _python_impl_supported python2_5 1 +test_is _python_impl_supported python2_6 1 +test_is _python_impl_supported python2_7 0 +test_is _python_impl_supported python3_1 1 +test_is _python_impl_supported python3_2 0 +test_is _python_impl_supported python3_3 0 +test_is _python_impl_supported python3_4 0 +test_is _python_impl_supported pypy1_8 1 +test_is _python_impl_supported pypy1_9 1 +test_is _python_impl_supported pypy2_0 1 +test_is _python_impl_supported pypy 0 +test_is _python_impl_supported jython2_5 0 +test_is _python_impl_supported jython2_7 0 + rm ${tmpfile} texit
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/06/19 08:08:10 Modified: python-utils-r1.sh Log: Improve handling of corner cases in python_fix_shebang. Support --force and --quiet options, bug #505354. Add tests. Revision ChangesPath 1.7 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.7view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.7content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.6r2=1.7 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- python-utils-r1.sh 8 Apr 2014 16:05:30 - 1.6 +++ python-utils-r1.sh 19 Jun 2014 08:08:10 - 1.7 @@ -30,6 +30,33 @@ tend ${?} } +test_fix_shebang() { + local from=${1} + local to=${2} + local expect=${3} + local args=( ${@:4} ) + + tbegin python_fix_shebang${args[@]+ ${args[*]}} from ${from} to ${to} (exp: ${expect}) + + echo ${from} ${tmpfile} + output=$( EPYTHON=${to} python_fix_shebang ${args[@]} -q ${tmpfile} 21 ) + + if [[ ${?} != 0 ]]; then + if [[ ${expect} != FAIL ]]; then + echo ${output} + tend 1 + else + tend 0 + fi + else + [[ $(${tmpfile}) == ${expect} ]] \ + || eerror ${from} - ${to}: $(${tmpfile}) != ${expect} + tend ${?} + fi +} + +tmpfile=$(mktemp) + inherit python-utils-r1 test_var EPYTHON python2_7 python2.7 @@ -66,4 +93,48 @@ test_is python_is_python3 jython2.7 1 test_is python_is_python3 pypy 1 +# generic shebangs +test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7' +test_fix_shebang '#!/usr/bin/python' python3.4 '#!/usr/bin/python3.4' +test_fix_shebang '#!/usr/bin/python' pypy '#!/usr/bin/pypy' +test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7' + +# 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.4 '#!/usr/bin/python3.4' +test_fix_shebang '#!/usr/bin/python2' python3.4 FAIL +test_fix_shebang '#!/usr/bin/python2' python3.4 '#!/usr/bin/python3.4' --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' pypy '#!/usr/bin/pypy' +test_fix_shebang '#!/usr/bin/pypy' python2.7 FAIL +test_fix_shebang '#!/usr/bin/pypy' python2.7 '#!/usr/bin/python2.7' --force +test_fix_shebang '#!/usr/bin/jython2.7' jython2.7 '#!/usr/bin/jython2.7' +test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 FAIL +test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 '#!/usr/bin/jython3.2' --force + +# fancy path handling +test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.4 \ + '#!/mnt/python2/usr/bin/python3.4' +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 + +rm ${tmpfile} + texit
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/04/08 16:05:31 Modified: python-utils-r1.sh Log: Disable pypy2_0 and clean up after it. Revision ChangesPath 1.6 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.6view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.6content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.5r2=1.6 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- python-utils-r1.sh 1 Apr 2014 15:22:40 - 1.5 +++ python-utils-r1.sh 8 Apr 2014 16:05:30 - 1.6 @@ -54,13 +54,6 @@ 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 pypy2_0 pypy-c2.0 -test_var PYTHON pypy2_0 /usr/bin/pypy-c2.0 -test_var PYTHON_SITEDIR pypy2_0 /usr/lib/pypy2.0/site-packages -test_var PYTHON_INCLUDEDIR pypy2_0 /usr/lib/pypy2.0/include -test_var PYTHON_PKG_DEP pypy2_0 '*virtual/pypy*:2.0' -test_var PYTHON_SCRIPTDIR pypy2_0 /usr/lib/python-exec/pypy-c2.0 - test_var EPYTHON pypy pypy test_var PYTHON pypy /usr/bin/pypy test_var PYTHON_SITEDIR pypy /usr/lib/pypy/site-packages @@ -71,7 +64,6 @@ 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 pypy2.0 1 test_is python_is_python3 pypy 1 texit
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/04/01 15:22:40 Modified: python-utils-r1.sh Log: Add slot op to expected PyPy dependency string. Revision ChangesPath 1.5 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.5view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.5content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.4r2=1.5 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- python-utils-r1.sh 12 Mar 2014 09:23:39 - 1.4 +++ python-utils-r1.sh 1 Apr 2014 15:22:40 - 1.5 @@ -65,7 +65,7 @@ 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_PKG_DEP pypy '*virtual/pypy*:0=' test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy test_is python_is_python3 python2.7 1
[gentoo-commits] gentoo-x86 commit in eclass/tests: python-utils-r1.sh
mgorny 14/03/12 09:23:39 Modified: python-utils-r1.sh Log: Add non-slotted pypy to the eclass. Revision ChangesPath 1.4 eclass/tests/python-utils-r1.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.4view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.4content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.3r2=1.4 Index: python-utils-r1.sh === RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- python-utils-r1.sh 3 Nov 2013 07:58:16 - 1.3 +++ python-utils-r1.sh 12 Mar 2014 09:23:39 - 1.4 @@ -61,9 +61,17 @@ test_var PYTHON_PKG_DEP pypy2_0 '*virtual/pypy*:2.0' test_var PYTHON_SCRIPTDIR pypy2_0 /usr/lib/python-exec/pypy-c2.0 +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 pypy2.0 1 +test_is python_is_python3 pypy 1 texit