test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / tap-bad-prog.tap
old mode 100755 (executable)
new mode 100644 (file)
index 82cf4e4..490cd4a
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #  - missing, unreadable, or not-executable test scripts cause proper
 #    error reports
 
-. ./defs || Exit 1
+. test-init.sh
 
 fetch_tap_driver
 
@@ -49,13 +49,8 @@ $AUTOMAKE
 
 ./configure
 
-if $MAKE check >stdout; then
-  r='not ok'
-else
-  r='ok'
-fi
-cat stdout
-result_ "$r" '"make check" returns non-zero exit status'
+command_ok_ '"make check" returns non-zero exit status' \
+            run_make -O -e FAIL check
 
 # FIXME: maybe grep for stricter error messages in the next checks?
 
@@ -99,7 +94,7 @@ else
     for s in '"missing plan" message' 'results'; do
       skip_ -r "IPC::Open3 not good enough" "no spurious $s"
     done
-    Exit 0
+    exit 0
   fi
 fi