2 # Copyright (C) 2001-2005, Parrot Foundation.
8 use Test::More tests => 8;
11 use File::Temp 0.13 qw/ tempdir /;
12 use lib qw( lib t/configure/testlib );
13 use IO::CaptureOutput qw| capture |;
15 BEGIN { use Parrot::Configure::Utils; }
20 $command = q{echo Hello world};
22 my $tdir = tempdir( CLEANUP => 1 );
23 chdir $tdir or croak "Unable to change to temporary directory";
27 my $rv = Parrot::Configure::Utils::_run_command( $command, $out, $err, $verbose );
28 is( $rv, 0, "Got expected exit code of 0" );
30 chdir $cwd or croak "Unable to change back to starting directory";
33 $command = q{echo Hello world};
35 my $tdir = tempdir( CLEANUP => 1 );
36 chdir $tdir or croak "Unable to change to temporary directory";
43 sub { $rv = Parrot::Configure::Utils::_run_command(
44 $command, $out, $err, $verbose ); },
47 is( $rv, 0, "Got expected exit code of 0" );
49 chdir $cwd or croak "Unable to change back to starting directory";
53 $command = q{echo Hello world};
55 my $tdir = tempdir( CLEANUP => 1 );
56 chdir $tdir or croak "Unable to change to temporary directory";
60 my $rv = Parrot::Configure::Utils::_run_command( $command, $out, $err, $verbose );
61 is( $rv, 0, "Got expected exit code of 0" );
63 chdir $cwd or croak "Unable to change back to starting directory";
66 $command = q{echo Hello world};
68 my $tdir = tempdir( CLEANUP => 1 );
69 chdir $tdir or croak "Unable to change to temporary directory";
71 my $err = q{/dev/null};
73 my $rv = Parrot::Configure::Utils::_run_command( $command, $out, $err, $verbose );
74 is( $rv, 0, "Got expected exit code of 0" );
76 chdir $cwd or croak "Unable to change back to starting directory";
79 $command = $^O eq 'MSWin32' ? q{dir} : q{date};
81 my $tdir = tempdir( CLEANUP => 1 );
82 chdir $tdir or croak "Unable to change to temporary directory";
88 sub { $rv = Parrot::Configure::Utils::_run_command(
89 $command, $out, $err, $verbose );
93 is( $rv, 0, "Got expected exit code of 0" );
95 chdir $cwd or croak "Unable to change back to starting directory";
98 $command = $^O eq 'MSWin32' ? q{dir} : q{date};
100 my $tdir = tempdir( CLEANUP => 1 );
101 chdir $tdir or croak "Unable to change to temporary directory";
105 my ($rv, $stdout, $stderr);
107 sub { $rv = Parrot::Configure::Utils::_run_command(
108 $command, $out, $err, $verbose );
113 is( $rv, 0, "Got expected exit code of 0" );
115 chdir $cwd or croak "Unable to change back to starting directory";
118 $command = $^O eq 'MSWin32' ? q{dir} : q{date};
120 my $tdir = tempdir( CLEANUP => 1 );
121 chdir $tdir or croak "Unable to change to temporary directory";
123 my $err = q{/dev/null};
125 my ($rv, $stdout, $stderr);
127 sub { $rv = Parrot::Configure::Utils::_run_command(
128 $command, $out, $err, $verbose );
133 is( $rv, 0, "Got expected exit code of 0" );
135 chdir $cwd or croak "Unable to change back to starting directory";
138 $command = $^O eq 'MSWin32' ? q{dir} : q{date};
140 my $tdir = tempdir( CLEANUP => 1 );
141 chdir $tdir or croak "Unable to change to temporary directory";
145 my ($rv, $stdout, $stderr);
147 sub { $rv = Parrot::Configure::Utils::_run_command(
148 $command, $out, $err, $verbose );
153 is( $rv, 0, "Got expected exit code of 0" );
155 chdir $cwd or croak "Unable to change back to starting directory";
158 ################### DOCUMENTATION ###################
162 t/configure/035-step.t - tests Parrot::Configure::Utils
166 prove t/configure/035-step.t
170 Regression tests for the L<Parrot::Configure::Utils> module. This file holds
171 tests for Parrot::Configure::Utils::_run_command().
177 # cperl-indent-level: 4
180 # vim: expandtab shiftwidth=4: