tests: fix recent regressions with dash

* 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.
This commit is contained in:
Pádraig Brady committed 2017-12-16 13:34:19 -08:00
1 parent a1300c60ef
commit 177f131385
2 files changed
+6 -3

No files matched your search

+2 -1
View File
@@ -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
+4 -2
View File
@@ -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