]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix issues on alpine linux
authorPádraig Brady <P@draigBrady.com>
Sat, 19 Aug 2017 22:36:54 +0000 (15:36 -0700)
committerPádraig Brady <P@draigBrady.com>
Sat, 19 Aug 2017 22:36:54 +0000 (15:36 -0700)
* tests/misc/seq-epipe.sh: Remove stale comment.
* tests/misc/sort-debug-warn.sh: musl doesn't indicate a set_locale()
failure with missing locales, so avoid a test portion in that case.
* tests/misc/wc-files0.sh: Avoid a bug on older ash implementations.
Addresses http://bugs.gnu.org/28054

tests/misc/seq-epipe.sh
tests/misc/sort-debug-warn.sh
tests/misc/wc-files0.sh

index 69dd75d6a3741b1bfd18d4f7ad9dde8bfc403cdb..f755590f53bc028cfec54aeb3fc3902866ee97d1 100755 (executable)
@@ -31,8 +31,6 @@ echo 1 > exp || framework_failure_
 compare exp out || fail=1
 compare exp code || fail=1
 
-# The error message must begin with "standard output:"
-# (but don't hard-code the strerror text)
 grep '^seq: write error: ' err \
   || { warn_ "seq emitted incorrect error on EPIPE"; \
        cat err;\
index 8119693496a770f75cf983ce3a3bcec7237f0f2c..0096cbdcee3b919537b93e4738953f79bcdd5345 100755 (executable)
@@ -70,9 +70,6 @@ sort: using simple byte comparison
 sort: using simple byte comparison
 17
 sort: using simple byte comparison
-18
-sort: failed to set locale
-sort: using simple byte comparison
 EOF
 
 echo 1 >> out
@@ -109,15 +106,25 @@ echo 16 >> out
 sort -rM --debug /dev/null 2>>out #no warning
 echo 17 >> out
 sort -rM -k1,1 --debug /dev/null 2>>out #no warning
-echo 18 >> out
-LC_ALL=missing sort --debug /dev/null 2>>out.t
-# musl libc accepts "missing" and implicitly uses UTF8,
-# so adjust the expected message accordingly.
-sed 's/using .*missing.* sorting rules/using simple byte comparison/' \
-  out.t >>out
 
 compare exp out || fail=1
 
+
+cat <<\EOF > exp
+sort: failed to set locale
+sort: using simple byte comparison
+EOF
+
+LC_ALL=missing sort --debug /dev/null 2>out
+
+# musl libc maps unknown locales to the default utf8 locale
+# with no way to determine failures.  This is discussed at:
+# http://www.openwall.com/lists/musl/2016/04/02/1
+if ! grep -E 'using .*(missing|C.UTF-8).* sorting rules' out; then
+  compare exp out || fail=1
+fi
+
+
 cat <<\EOF > exp
 sort: using simple byte comparison
 sort: key 1 is numeric and spans multiple fields
index 32d5e63e8bd34b10e704fea2887c160a5a57dddb..51ed388db53e624187e1429b8f68b6ca0a7ae641 100755 (executable)
@@ -45,7 +45,7 @@ nlname='1
 2'
 touch "$nlname" || framework_failure_
 printf '%s\0' "$nlname" | wc --files0-from=- > out || fail=1
-printf '%s\n' "0 0 0 '1'$'\\n''2'" > exp || framework_failure_
+printf '%s\n' "0 0 0 '1'\$'\\n''2'" > exp || framework_failure_
 compare exp out || fail=1
 
 # Ensure correct byte counts, which fails between v8.24 and v8.26 inclusive