]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix recent regressions with dash
authorPádraig Brady <P@draigBrady.com>
Sat, 16 Dec 2017 21:34:19 +0000 (13:34 -0800)
committerPádraig Brady <P@draigBrady.com>
Sat, 16 Dec 2017 21:34:19 +0000 (13:34 -0800)
* tests/misc/timeout.sh: dash outputs the "Killed"
message to stderr rather than the terminal.
* tests/misc/usage_vs_getopt.sh: dash doesn't yet
support the POSIX proposed $'...' shell quoting syntax.

tests/misc/timeout.sh
tests/misc/usage_vs_getopt.sh

index 77d5998db87855fb64e0ffc08f290e4af2ea5957..268897171bbb6c62a63c1ab12587e5a24b495301 100755 (executable)
@@ -63,7 +63,8 @@ timeout: sending signal EXIT to command 'sleep'
 timeout: sending signal KILL to command 'sleep'
 EOF
 for opt in -v --verbose; do
-  timeout $opt -s0 -k .1 .1 sleep 10 2> err
+  timeout $opt -s0 -k .1 .1 sleep 10 2> errt
+  sed '/^Killed/d' < errt > err || framework_failure_
   compare exp err || fail=1
 done
 
index 1d6cf92424f67b1c5c9cfa7b11218038e0f249b3..bcecbc562fc205b7aeccb95f8d266da2b5d7c399 100755 (executable)
@@ -34,7 +34,7 @@ checkprg () {
   grep -F "$o" err || framework_failure_
   sed -n "1s/--$o/OPT/p" < err > pat || framework_failure_
 
-  # Append the pattern for a short unkown option.
+  # Append the pattern for a short unknown option.
   returns_ $rcexp $prg -/ >/dev/null 2> err || fail=1
   grep -F "'/'" err || framework_failure_
   sed -n "1s/'\/'/'OPT'/p" < err >> pat || framework_failure_
@@ -43,8 +43,10 @@ checkprg () {
   $prg --help > help || fail=1
 
   # Extract all options mention in the above --help output.
+  nl="
+  "
   sed -n -e '/--version/q' \
-    -e 's/^ \{2,6\}-/-/; s/  .*//; s/[=[].*//; s/, /\'$'\n''/g; s/^-/-/p' help \
+    -e 's/^ \{2,6\}-/-/; s/  .*//; s/[=[].*//; s/, /\'"$nl"'/g; s/^-/-/p' help \
     > opts || framework_failure_
   cat opts  # for debugging purposes