summaryrefslogtreecommitdiff
path: root/tests/join
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-11-17 17:37:22 +0000
committerJim Meyering <jim@meyering.net>1994-11-17 17:37:22 +0000
commit42c03d3135bd3b05f5e829436adefbc16a9b0a1a (patch)
treeb0e22e634e2c0a51db37cabcbbabe1d74e71ddd7 /tests/join
parentfdfd720ec4e44b9b35368c9ea483f56fa0b69847 (diff)
downloadcoreutils-42c03d3135bd3b05f5e829436adefbc16a9b0a1a.tar.xz
.
Diffstat (limited to 'tests/join')
-rw-r--r--tests/join/Makefile4
-rwxr-xr-xtests/join/build-script32
2 files changed, 24 insertions, 12 deletions
diff --git a/tests/join/Makefile b/tests/join/Makefile
index 683b343a8..d37029055 100644
--- a/tests/join/Makefile
+++ b/tests/join/Makefile
@@ -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
diff --git a/tests/join/build-script b/tests/join/build-script
index 1dd2ed32f..98908b279 100755
--- a/tests/join/build-script
+++ b/tests/join/build-script
@@ -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 ;