summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-08-05 04:04:49 +0000
committerJim Meyering <jim@meyering.net>1996-08-05 04:04:49 +0000
commitaa49f63378a80ebdbac1b269d95bc07c8b43347b (patch)
tree8c31e9ebf422ad9858fb4bc643b9c4f27df96891 /tests
parent1a038cb55e587b7e46a2a55acec43e340fef2d6a (diff)
downloadcoreutils-aa49f63378a80ebdbac1b269d95bc07c8b43347b.tar.xz
.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tr/build-script.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/tr/build-script.pl b/tests/tr/build-script.pl
index 14671587a..8487cec46 100755
--- a/tests/tr/build-script.pl
+++ b/tests/tr/build-script.pl
@@ -15,9 +15,11 @@ esac
echo=echo
\$echo testing with $xx=\$xx
errors=0
+test "\$srcdir" || srcdir=.
+test "\$verbose" && \$xx --version 2> /dev/null
EOF
-print "# $xx --version 2> /dev/null\n";
+
my %seen;
while (<>)
@@ -34,7 +36,7 @@ while (<>)
if (defined ($seen{$test_name}));
$seen{$test_name} = 1;
my $in = "t$test_name.in";
- my $exp_name = 't' . $test_name . '.exp';
+ my $exp_name = "t$test_name.exp";
my $out = "t$test_name.out";
open(IN, ">$in") || die "$0: $in: $!\n";
@@ -45,7 +47,8 @@ while (<>)
close(EXP);
my $arg2 = ($s2 ? " '$s2'" : '');
my $err_output = "t$test_name.err";
- my $cmd = "\$xx $flags \'$s1\'$arg2 < $in > $out 2> $err_output";
+ my $cmd = "\$xx $flags \'$s1\'$arg2 < \$srcdir/$in > $out 2> $err_output";
+ $exp_name = "\$srcdir/$exp_name";
print <<EOF ;
$cmd
code=\$?
@@ -53,7 +56,7 @@ if test \$code != $e_ret_code ; then
\$echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
errors=`expr \$errors + 1`
else
- cmp $out $exp_name
+ cmp $out \$srcdir/$exp_name
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;