diff options
author | Jim Meyering <jim@meyering.net> | 1996-08-04 23:34:33 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-08-04 23:34:33 +0000 |
commit | 406c6613bba368ece708f79d19c5a11730c74034 (patch) | |
tree | b1fafe6ff78d5f300ff694df1084934398956fe8 /tests/tr/build-script | |
parent | c5449cea5a9d59cad3d000d728bd40482cbd294d (diff) | |
download | coreutils-406c6613bba368ece708f79d19c5a11730c74034.tar.xz |
.
Diffstat (limited to 'tests/tr/build-script')
-rwxr-xr-x | tests/tr/build-script | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/tests/tr/build-script b/tests/tr/build-script deleted file mode 100755 index 46513bfdd..000000000 --- a/tests/tr/build-script +++ /dev/null @@ -1,77 +0,0 @@ -#!/p/bin/perl -w -require 5.002; -use strict; - -my $xx = './tr'; -$| = 1; - -print <<EOF; -#! /bin/sh -case \$# in - 0) xx='$xx';; - *) xx="\$1";; -esac -echo=: -\$echo testing with $xx=\$xx -errors=0 -EOF - -print "# $xx --version 2> /dev/null\n"; -my %seen; - -while (<>) - { - next if (/^\s*#/); - - chop; - my ($test_name, $input, $flags, $s1, $s2, $expected, $e_ret_code); - my $prog = - '($test_name, $input, $flags, $s1, $s2, $expected, $e_ret_code) = ' - . $_ . ';'; - eval $prog; - die "$0: $.: duplicate test name \`$test_name'\n" - if (defined ($seen{$test_name})); - $seen{$test_name} = 1; - my $in = "t$test_name.in"; - my $exp_name = 't' . $test_name . '.exp'; - my $out = "t$test_name.out"; - - open(IN, ">$in") || die "Couldn't open $in for writing.\n"; - print IN $input; - close(IN); - open(EXP, ">$exp_name") - || die "Couldn't open $exp_name for writing.\n"; - print EXP $expected; - close(EXP); - my $arg2 = ($s2 ? " '$s2'" : ''); - my $err_output = "t$test_name.err"; - my $cmd = "\$xx $flags \'$s1\'$arg2 < $in > $out 2> $err_output"; - print <<EOF ; -$cmd -code=\$? -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 - 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` ;; - esac -fi -test -s $err_output || rm -f $err_output -EOF - } -print <<EOF2 ; -if test \$errors = 0 ; then - \$echo Passed all tests. 1>&2 -else - \$echo Failed \$errors tests. 1>&2 -fi -test \$errors = 0 && \$errors=1 -exit \$errors -EOF2 |