]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
.
authorJim Meyering <jim@meyering.net>
Thu, 17 Nov 1994 17:37:22 +0000 (17:37 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 17 Nov 1994 17:37:22 +0000 (17:37 +0000)
tests/join/Makefile
tests/join/build-script

index 683b343a80616fbbf36a5233e153bf5cb51c97d7..d37029055f995dd796732ac1ebf4292adc414841 100644 (file)
@@ -9,11 +9,11 @@ join-tests: main build-script test.data.pl
 
 .PHONY: distclean
 distclean:
-       rm -f t*.out
+       rm -f t*.out core
 
 .PHONY: clean
 clean: distclean
 
 .PHONY: realclean
 realclean: clean
-       rm -f join-tests t*.in t*.exp
+       rm -f join-tests t*.[12] t*.exp t*.log
index 1dd2ed32f67669d123b73f019456e7381d0dbbdf..98908b27915236a859c75f57f7f7204ecca23ec1 100755 (executable)
@@ -27,6 +27,7 @@ while (<>)
     $seen{$test_name} = 1;
     $in1 = "t$test_name.1"; 
     $in2 = "t$test_name.2"; 
+    $log = "t$test_name.log"; 
     $exp_name = 't' . $test_name . '.exp'; 
     $out = "t$test_name.out"; 
 
@@ -42,22 +43,33 @@ while (<>)
     close(EXP);
     $cmd = "$join $flags $in1 $in2 > $out";
     print <<EOF ;
-$cmd 2> /dev/null
+$cmd 2> $log
 code=\$?
+fail=yes
 if test \$code != $e_ret_code ; then
-  echo Test $test_name failed: join return code \$code differs from expected value $e_ret_code 1>&2
-  errors=`expr \$errors + 1`
+  err_msg="Test $test_name failed: join return code \$code differs from expected value $e_ret_code"
 else
-  cmp $out $exp_name
+  cmp $out $exp_name >> $log 2>&1
   case \$? in
-    0) if test "\$verbose" ; then echo passed $test_name; fi ;; # equal files
-    1) echo Test $test_name failed: files $out and $exp_name differ 1>&2;
-       errors=`expr \$errors + 1` ;;
-    2) echo Test $test_name may have failed. 1>&2;
-       echo The command \"cmp $out $exp_name\" failed. 1>&2 ;
-       errors=`expr \$errors + 1` ;;
+    0) # equal files
+       if test "\$verbose" ; then
+        echo passed $test_name
+       fi
+       fail=no
+       ;;
+    1) err_msg="Test $test_name failed: files $out and $exp_name differ"
+       ;;
+    2) err_msg="Test $test_name may have failed.
+echo The command \"cmp $out $exp_name\" failed."
+       ;;
   esac
 fi
+if test \$fail = yes; then
+  errors=`expr \$errors + 1`
+  echo "Failing command: $cmd" >> $log
+  echo "\$err_msg" >> $log
+fi
+test -s $log || rm -f $log
 EOF
   }
 print <<EOF2 ;