Skip to content
Snippets Groups Projects
Commit c1a59a20 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

initial import

parent 963f5e67
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl
use strict;
use warnings;
use English qw(-no_match_vars);
use IPC::Run qw(run);
use Test::More;
plan tests => 6;
my ($out, $err, $rc);
($out, $err, $rc) = run_executable('account-manager.pl', '--help');
ok($rc == 0, '--help exit status');
is($err, '', '--help stderr');
like(
$out,
qr/^Usage:/,
'--help stdout'
);
($out, $err, $rc) = run_executable('account-manager.pl');
ok($rc == 2, 'no action exit status');
like(
$err,
qr/no action given, aborting/,
'no action stderr'
);
is($out, '', 'no action stdout');
sub run_executable {
my ($executable, $args) = @_;
my @args = $args ? split(/\s+/, $args) : ();
run(
[ $EXECUTABLE_NAME, 'bin/' . $executable, @args ],
\my ($in, $out, $err)
);
return ($out, $err, $CHILD_ERROR >> 8);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment