mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-08-08 18:22:09 +03:00
tests: Coreutils.pm: support running a program that is a shell built-in
* tests/Coreutils.pm (run_tests): Add support for running a program like 'test', that is a shell built-in.
This commit is contained in:
@@ -214,6 +214,11 @@ sub run_tests ($$$$$)
|
|||||||
{
|
{
|
||||||
my ($program_name, $prog, $t_spec, $save_temps, $verbose) = @_;
|
my ($program_name, $prog, $t_spec, $save_temps, $verbose) = @_;
|
||||||
|
|
||||||
|
# To indicate that $prog is a shell built-in, you'd make it a string 'ref'.
|
||||||
|
# E.g., call run_tests ($prog, \$prog, \@Tests, $save_temps, $verbose);
|
||||||
|
# If it's a ref, invoke it via "env":
|
||||||
|
my @prog = ref $prog ? ('env', $$prog) : $prog;
|
||||||
|
|
||||||
# Warn about empty t_spec.
|
# Warn about empty t_spec.
|
||||||
# FIXME
|
# FIXME
|
||||||
|
|
||||||
@@ -260,7 +265,7 @@ sub run_tests ($$$$$)
|
|||||||
return 1 if $bad_test_name;
|
return 1 if $bad_test_name;
|
||||||
|
|
||||||
# FIXME check exit status
|
# FIXME check exit status
|
||||||
system ($prog, '--version') if $verbose;
|
system (@prog, '--version') if $verbose;
|
||||||
|
|
||||||
my @junk_files;
|
my @junk_files;
|
||||||
my $fail = 0;
|
my $fail = 0;
|
||||||
@@ -445,7 +450,7 @@ sub run_tests ($$$$$)
|
|||||||
$actual{OUT} = "$test_name.O";
|
$actual{OUT} = "$test_name.O";
|
||||||
$actual{ERR} = "$test_name.E";
|
$actual{ERR} = "$test_name.E";
|
||||||
push @junk_files, $actual{OUT}, $actual{ERR};
|
push @junk_files, $actual{OUT}, $actual{ERR};
|
||||||
my @cmd = ($prog, @args, "> $actual{OUT}", "2> $actual{ERR}");
|
my @cmd = (@prog, @args, "> $actual{OUT}", "2> $actual{ERR}");
|
||||||
$env_prefix
|
$env_prefix
|
||||||
and unshift @cmd, $env_prefix;
|
and unshift @cmd, $env_prefix;
|
||||||
defined $input_pipe_cmd
|
defined $input_pipe_cmd
|
||||||
|
Reference in New Issue
Block a user