diff options
Diffstat (limited to 'src/test/perl/TestLib.pm')
-rw-r--r-- | src/test/perl/TestLib.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index b9cb51b9d39..ce59401cefa 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -36,6 +36,7 @@ our @EXPORT = qw( system_or_bail system_log run_log + run_command command_ok command_fails @@ -203,6 +204,16 @@ sub run_log return IPC::Run::run(@_); } +sub run_command +{ + my ($cmd) = @_; + my ($stdout, $stderr); + my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; + chomp($stdout); + chomp($stderr); + return ($stdout, $stderr); +} + # Generate a string made of the given range of ASCII characters sub generate_ascii_string { |