]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: fix py-compile-basedir.sh: missing "test"
authorJim Meyering <meyering@fb.com>
Tue, 18 Jan 2022 10:00:22 +0000 (02:00 -0800)
committerJim Meyering <meyering@fb.com>
Tue, 18 Jan 2022 10:00:22 +0000 (02:00 -0800)
Prompted by a patch from Thomas Deutschmann <whissi@gentoo.org>,
via https://lists.gnu.org/r/automake-patches/2022-01/msg00001.html:
commit v1.16.1-26-gb279a0d46 ("tests: in python tests, do not
require .pyo files (for python3)") was missing a `test` call.
Reported to Gentoo at https://bugs.gentoo.org/715040.
* t/py-compile-basedir.sh: Rather than just adding the missing
"test", rewrite using a case statement, to avoid some duplication.

t/py-compile-basedir.sh

index 44b6b07c1962584621aa33867880bac4ed64d157..22e605f9de50081794157ef820b9d9e20402e1ef 100644 (file)
@@ -43,7 +43,7 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
   py_installed "$d2/sub/$f.pyc"
   files=$(find "$d2" | grep '\.py[co]$')
   # with new-enough Python3, there are six files.
-  test $(echo "$files" | wc -l) -eq 4 || $(echo "$files" | wc -l) -eq 6
+  case $(echo "$files" | wc -l) in 4|6) ;; *) false;; esac
   case $d2 in
     .|..) rm -f $files;;
        *) rm -rf "$d2";;