diff --git a/t/02_exit.t b/t/02_exit.t index 6bb3dd3..254019d 100644 --- a/t/02_exit.t +++ b/t/02_exit.t @@ -15,6 +15,11 @@ if ($^O ne 'VMS') { use IPC::System::Simple qw(run EXIT_ANY); chdir("t"); # Ignore return, since we may already be in t/ +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + run($perl_path,"exiter.pl",0); ok(1,"Multi-arg implicit zero allowed"); diff --git a/t/03_signal.t b/t/03_signal.t index 8cf07e1..f5c3ef7 100644 --- a/t/03_signal.t +++ b/t/03_signal.t @@ -24,6 +24,11 @@ use_ok("IPC::System::Simple","run"); chdir("t"); +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + run([1],$perl_path,"signaler.pl",0); ok(1); diff --git a/t/04_capture.t b/t/04_capture.t index 6a75a7a..32ec00d 100644 --- a/t/04_capture.t +++ b/t/04_capture.t @@ -20,6 +20,11 @@ my $output_exe = "$perl_path output.pl"; use_ok("IPC::System::Simple","capture"); chdir("t"); +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + # Scalar capture my $output = capture($output_exe); diff --git a/t/05_multi_capture.t b/t/05_multi_capture.t index ce7ad62..d6f2325 100644 --- a/t/05_multi_capture.t +++ b/t/05_multi_capture.t @@ -19,6 +19,11 @@ if ($^O ne 'VMS') { use_ok("IPC::System::Simple","capture"); chdir("t"); +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + # The tests below for $/ are left in, even though IPC::System::Simple # never touches $/ diff --git a/t/07_taint.t b/t/07_taint.t index b16ef8e..35a4ae0 100644 --- a/t/07_taint.t +++ b/t/07_taint.t @@ -17,6 +17,11 @@ use_ok("IPC::System::Simple","run","capture"); chdir("t"); # Ignore return, since we may already be in t/ +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + my $taint = $0 . "foo"; # ."foo" to avoid zero length ok(tainted($taint),"Sanity - executable name is tainted"); diff --git a/t/08_core.t b/t/08_core.t index 221f133..871aebb 100644 --- a/t/08_core.t +++ b/t/08_core.t @@ -36,6 +36,11 @@ use_ok("IPC::System::Simple","run"); chdir("t"); +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + my $rlimit_success = setrlimit(RLIMIT_CORE, RLIM_INFINITY, RLIM_INFINITY); SKIP: { diff --git a/t/09_system.t b/t/09_system.t index 77c7d51..e5955b6 100644 --- a/t/09_system.t +++ b/t/09_system.t @@ -15,6 +15,11 @@ if ($^O ne 'VMS') { use IPC::System::Simple qw(system); chdir("t"); # Ignore return, since we may already be in t/ +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + system($perl_path,"exiter.pl",0); ok(1,"Multi-arg system"); diff --git a/t/11_newlines.t b/t/11_newlines.t index 9f40aa5..d0cec9c 100644 --- a/t/11_newlines.t +++ b/t/11_newlines.t @@ -11,6 +11,12 @@ if ($^O ne 'VMS') { unless $perl_path =~ m/$Config{_exe}$/i; } +chdir("t"); # Ignore return, since we may already be in t/ +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + eval { run( "$perl_path -e1" ) }; is($@, "", 'Run works with single arg'); diff --git a/t/12_systemx.t b/t/12_systemx.t index 6d08e4b..a4a04eb 100644 --- a/t/12_systemx.t +++ b/t/12_systemx.t @@ -14,6 +14,11 @@ if ($^O ne 'VMS') { chdir("t"); # Ignore return, since we may already be in t/ +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + my $exit_test = "$perl_path exiter.pl 0"; eval { diff --git a/t/win32.t b/t/win32.t index eee596d..13208b4 100644 --- a/t/win32.t +++ b/t/win32.t @@ -40,6 +40,11 @@ ok($raw_perl, "Have perl executables with and w/o extensions."); chdir("t"); +#Close STDIN (and reopen to prevent warnings) +#If Perl is called with no arguments, it waits for input on STDIN. +close STDIN; +open STDIN, '<', '/dev/null'; + # Check for 16 and 32 bit returns. foreach my $big_exitval (SMALL_EXIT, BIG_EXIT, HUGE_EXIT) {