summaryrefslogtreecommitdiff
path: root/t/missing3.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/missing3.sh')
-rwxr-xr-xt/missing3.sh43
1 files changed, 19 insertions, 24 deletions
diff --git a/t/missing3.sh b/t/missing3.sh
index c5db4f038..3a9ba013f 100755
--- a/t/missing3.sh
+++ b/t/missing3.sh
@@ -23,31 +23,26 @@ get_shell_script missing
# b7cb8259 assumed not to exist.
-./missing b7cb8259 --version 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep . stderr && exit 1
-./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep WARNING stderr
-
-./missing --run b7cb8259 --version && exit 1
-./missing --run b7cb8259 --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep WARNING stderr
+run_cmd ()
+{
+ st=0; "$@" >stdout 2>stderr || st=$?
+ cat stdout
+ cat stderr >&2
+ return $st
+}
+
+./missing b7cb8259 --version && exit 1
+grep WARNING stderr && exit 1
+run_cmd ./missing b7cb8259 --grep && exit 1
+grep 'WARNING:.*missing on your system' stderr
# missing itself it known to exist :)
-./missing ./missing --version 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep . stderr && exit 1
-./missing ./missing --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep WARNING stderr
-
-./missing --run ./missing --version 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep . stderr && exit 1
-./missing --run ./missing --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_cmd ./missing ./missing --version || exit 1
+grep 'missing .*(GNU [aA]utomake)' stdout
+test -s stderr && exit 1
+run_cmd ./missing ./missing --grep && exit 1
grep WARNING stderr && exit 1
-grep Unknown stderr
+grep "missing:.* unknown '--grep'" stderr
+
+: