From: Bruno Haible Date: Tue, 16 Jul 2024 12:59:00 +0000 (+0200) Subject: lang-python-*: Avoid SKIP on macOS. X-Git-Tag: v0.23~248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfe6abb2006e47d58add60568369c533a0a72fd8;p=thirdparty%2Fgettext.git lang-python-*: Avoid SKIP on macOS. * gettext-tools/tests/lang-python-1: Search for 'python3' and 'python'. * gettext-tools/tests/lang-python-2: Likewise. --- diff --git a/gettext-tools/tests/lang-python-1 b/gettext-tools/tests/lang-python-1 index f992cf387..1351b01f8 100755 --- a/gettext-tools/tests/lang-python-1 +++ b/gettext-tools/tests/lang-python-1 @@ -64,9 +64,16 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po # Test for presence of python version 2.0 or newer. -(python -V) >/dev/null 2>/dev/null \ - || { echo "Skipping test: python not found"; Exit 77; } -case `python -c 'import sys; print(sys.hexversion >= 0x20000F0)'` in +if (python3 -V) >/dev/null 2>/dev/null; then + PYTHON=python3 +else + if (python -V) >/dev/null 2>/dev/null; then + PYTHON=python + else + echo "Skipping test: python not found"; Exit 77 + fi +fi +case `$PYTHON -c 'import sys; print(sys.hexversion >= 0x20000F0)'` in 1 | True) ;; *) echo "Skipping test: python version too old"; Exit 77;; esac @@ -85,13 +92,13 @@ EOF : ${LOCALE_FR_UTF8=fr_FR.UTF-8} if test $LOCALE_FR_UTF8 != none; then prepare_locale_ fr $LOCALE_FR_UTF8 - LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 python prog1.py > prog.out || Exit 1 + LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 $PYTHON prog1.py > prog.out || Exit 1 ${DIFF} prog.oku prog.out || Exit 1 fi if test -z "$ISO8859_LOCALE_UNSUPPORTED"; then if test $LOCALE_FR != none; then prepare_locale_ fr $LOCALE_FR - LANGUAGE= LC_ALL=$LOCALE_FR python prog1.py > prog.out || Exit 1 + LANGUAGE= LC_ALL=$LOCALE_FR $PYTHON prog1.py > prog.out || Exit 1 ${DIFF} prog.ok prog.out || Exit 1 fi if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then diff --git a/gettext-tools/tests/lang-python-2 b/gettext-tools/tests/lang-python-2 index 332100f2c..2b2444624 100755 --- a/gettext-tools/tests/lang-python-2 +++ b/gettext-tools/tests/lang-python-2 @@ -83,9 +83,16 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po # Test for presence of python version 2.3 or newer. -(python -V) >/dev/null 2>/dev/null \ - || { echo "Skipping test: python not found"; Exit 77; } -case `python -c 'import sys; print(sys.hexversion >= 0x20300F0)'` in +if (python3 -V) >/dev/null 2>/dev/null; then + PYTHON=python3 +else + if (python -V) >/dev/null 2>/dev/null; then + PYTHON=python + else + echo "Skipping test: python not found"; Exit 77 + fi +fi +case `$PYTHON -c 'import sys; print(sys.hexversion >= 0x20300F0)'` in 1 | True) ;; *) echo "Skipping test: python version too old"; Exit 77;; esac @@ -106,13 +113,13 @@ EOF : ${LOCALE_FR_UTF8=fr_FR.UTF-8} if test $LOCALE_FR_UTF8 != none; then prepare_locale_ fr $LOCALE_FR_UTF8 - LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 python prog2.py 2 > prog.out || Exit 1 + LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 $PYTHON prog2.py 2 > prog.out || Exit 1 ${DIFF} prog.oku prog.out || Exit 1 fi if test -z "$ISO8859_LOCALE_UNSUPPORTED"; then if test $LOCALE_FR != none; then prepare_locale_ fr $LOCALE_FR - LANGUAGE= LC_ALL=$LOCALE_FR python prog2.py 2 > prog.out || Exit 1 + LANGUAGE= LC_ALL=$LOCALE_FR $PYTHON prog2.py 2 > prog.out || Exit 1 ${DIFF} prog.ok prog.out || Exit 1 fi if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then