coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: fix recent regressions with dash


From: Pádraig Brady
Subject: [PATCH] tests: fix recent regressions with dash
Date: Sat, 16 Dec 2017 13:37:12 -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         | 3 ++-
 tests/misc/usage_vs_getopt.sh | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/misc/timeout.sh b/tests/misc/timeout.sh
index 77d5998..2688971 100755
--- a/tests/misc/timeout.sh
+++ b/tests/misc/timeout.sh
@@ -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
 
diff --git a/tests/misc/usage_vs_getopt.sh b/tests/misc/usage_vs_getopt.sh
index 1d6cf92..bcecbc5 100755
--- a/tests/misc/usage_vs_getopt.sh
+++ b/tests/misc/usage_vs_getopt.sh
@@ -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
 
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]