From 3a2afe3311b6afe13e0fc36bbe46838debb41ef4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 15 Dec 1996 20:35:32 +0000 Subject: [PATCH] apply spec_to_list to expected file, too. --- tests/cut/mk-script.pl | 18 +++++++----------- tests/head/mk-script.pl | 18 +++++++----------- tests/join/mk-script.pl | 18 +++++++----------- tests/ls/mk-script.pl | 18 +++++++----------- 4 files changed, 28 insertions(+), 44 deletions(-) diff --git a/tests/cut/mk-script.pl b/tests/cut/mk-script.pl index f1a4fa4..9ae9778 100644 --- a/tests/cut/mk-script.pl +++ b/tests/cut/mk-script.pl @@ -111,20 +111,11 @@ EOF my $test_vector; foreach $test_vector (@Test::t) { - my ($test_name, $flags, $in_spec, $expected, $e_ret_code) + my ($test_name, $flags, $in_spec, $exp_spec, $e_ret_code) = @{$test_vector}; my $in = spec_to_list ($in_spec, $test_name, 'in'); - my $exp_name = "t$test_name.exp"; - my $out = "t$test_name.out"; - - open (EXP, ">$exp_name") || die "$0: $exp_name: $!\n"; - print EXP $expected; - close (EXP) || die "$0: $exp_name: $!\n"; - - my $err_output = "t$test_name.err"; - my @srcdir_rel_in_file; my $f; foreach $f (@{ $in->{ALL_FILES} }) @@ -132,9 +123,14 @@ foreach $test_vector (@Test::t) push (@srcdir_rel_in_file, "\$srcdir/$f") } + my $Exp = spec_to_list ($exp_spec, $test_name, 'exp'); + assert (@{ $Exp->{ALL_FILES} } == 1); + my $exp_name = "\$srcdir/$Exp->{ALL_FILES}->[0]"; + my $out = "t$test_name.out"; + my $err_output = "t$test_name.err"; + my $cmd = "\$xx $flags " . join (' ', @srcdir_rel_in_file) . " > $out 2> $err_output"; - $exp_name = "\$srcdir/$exp_name"; print <$exp_name") || die "$0: $exp_name: $!\n"; - print EXP $expected; - close (EXP) || die "$0: $exp_name: $!\n"; - - my $err_output = "t$test_name.err"; - my @srcdir_rel_in_file; my $f; foreach $f (@{ $in->{ALL_FILES} }) @@ -132,9 +123,14 @@ foreach $test_vector (@Test::t) push (@srcdir_rel_in_file, "\$srcdir/$f") } + my $Exp = spec_to_list ($exp_spec, $test_name, 'exp'); + assert (@{ $Exp->{ALL_FILES} } == 1); + my $exp_name = "\$srcdir/$Exp->{ALL_FILES}->[0]"; + my $out = "t$test_name.out"; + my $err_output = "t$test_name.err"; + my $cmd = "\$xx $flags " . join (' ', @srcdir_rel_in_file) . " > $out 2> $err_output"; - $exp_name = "\$srcdir/$exp_name"; print <$exp_name") || die "$0: $exp_name: $!\n"; - print EXP $expected; - close (EXP) || die "$0: $exp_name: $!\n"; - - my $err_output = "t$test_name.err"; - my @srcdir_rel_in_file; my $f; foreach $f (@{ $in->{ALL_FILES} }) @@ -132,9 +123,14 @@ foreach $test_vector (@Test::t) push (@srcdir_rel_in_file, "\$srcdir/$f") } + my $Exp = spec_to_list ($exp_spec, $test_name, 'exp'); + assert (@{ $Exp->{ALL_FILES} } == 1); + my $exp_name = "\$srcdir/$Exp->{ALL_FILES}->[0]"; + my $out = "t$test_name.out"; + my $err_output = "t$test_name.err"; + my $cmd = "\$xx $flags " . join (' ', @srcdir_rel_in_file) . " > $out 2> $err_output"; - $exp_name = "\$srcdir/$exp_name"; print <$exp_name") || die "$0: $exp_name: $!\n"; - print EXP $expected; - close (EXP) || die "$0: $exp_name: $!\n"; - - my $err_output = "t$test_name.err"; - my @srcdir_rel_in_file; my $f; foreach $f (@{ $in->{ALL_FILES} }) @@ -132,9 +123,14 @@ foreach $test_vector (@Test::t) push (@srcdir_rel_in_file, "\$srcdir/$f") } + my $Exp = spec_to_list ($exp_spec, $test_name, 'exp'); + assert (@{ $Exp->{ALL_FILES} } == 1); + my $exp_name = "\$srcdir/$Exp->{ALL_FILES}->[0]"; + my $out = "t$test_name.out"; + my $err_output = "t$test_name.err"; + my $cmd = "\$xx $flags " . join (' ', @srcdir_rel_in_file) . " > $out 2> $err_output"; - $exp_name = "\$srcdir/$exp_name"; print <