use File::Compare qw(compare);
@ISA = qw(Exporter);
-($VERSION = '$Revision: 1.2 $ ') =~ tr/[0-9].//cd;
+($VERSION = '$Revision: 1.3 $ ') =~ tr/[0-9].//cd;
@EXPORT = qw (run_tests);
my $debug = $ENV{DEBUG};
-my @Types = qw (IN OUT ERR AUX CMP EXIT PRE POST OUT_SUBST ERR_SUBST ENV ENV_DEL);
+my @Types = qw (IN IN_PIPE OUT ERR AUX CMP EXIT PRE POST OUT_SUBST
+ ERR_SUBST ENV ENV_DEL);
my %Types = map {$_ => 1} @Types;
my %Zero_one_type = map {$_ => 1}
qw (OUT ERR EXIT PRE POST OUT_SUBST ERR_SUBST ENV);
my %seen_type;
my @env_delete;
my $env_prefix = '';
+ my $input_pipe_cmd;
foreach $io_spec (@$t)
{
if (!ref $io_spec)
my $file = _process_file_spec ($program_name, $test_name, $val,
$type, \@junk_files);
- if ($type eq 'IN')
+ if ($type eq 'IN' || $type eq 'IN_PIPE')
{
- push @args, _shell_quote $file;
+ my $quoted_file = _shell_quote $file;
+ if ($type eq 'IN_PIPE')
+ {
+ defined $input_pipe_cmd
+ and die "$program_name: $test_name: only one input"
+ . " may be specified with IN_PIPE\n";
+ $input_pipe_cmd = "cat $quoted_file |";
+ }
+ else
+ {
+ push @args, $quoted_file;
+ }
}
elsif ($type eq 'AUX' || $type eq 'OUT' || $type eq 'ERR')
{
$actual{ERR} = "$test_name.E";
push @junk_files, $actual{OUT}, $actual{ERR};
my @cmd = ($prog, @args, "> $actual{OUT}", "2> $actual{ERR}");
+ defined $input_pipe_cmd
+ and unshift @cmd, $input_pipe_cmd;
my $cmd_str = $env_prefix . join (' ', @cmd);
# Delete from the environment any symbols specified by syntax