@@ -21,7 +21,6 @@ TestLib - helper module for writing PostgreSQL's C<prove> tests.
2121
2222 # Miscellanea
2323 print "on Windows" if $TestLib::windows_os;
24- print "IO::Pty is available" if $TestLib::have_io_pty;
2524 my $path = TestLib::perl2host($backup_dir);
2625 ok(check_mode_recursive($stream_dir, 0700, 0600),
2726 "check stream dir permissions");
@@ -84,12 +83,9 @@ our @EXPORT = qw(
8483 command_checks_all
8584
8685 $windows_os
87- $have_io_pty
8886) ;
8987
90- our ($windows_os ,$tmp_check ,$log_path ,$test_logfile ,$have_io_pty );
91-
92- my @no_stdin ;
88+ our ($windows_os ,$tmp_check ,$log_path ,$test_logfile );
9389
9490BEGIN
9591{
@@ -121,9 +117,6 @@ BEGIN
121117require Win32API::File;
122118Win32API::File-> import (qw( createFile OsFHandleOpen CloseHandle) );
123119}
124-
125- eval {require IO::Pty; };
126- $have_io_pty = 1unless $@ ;
127120}
128121
129122=pod
@@ -138,12 +131,6 @@ Set to true when running under Windows, except on Cygwin.
138131
139132=back
140133
141- =item C<$have_io_pty >
142-
143- Set to true when IO::Pty is available.
144-
145- =back
146-
147134=cut
148135
149136INIT
@@ -191,20 +178,6 @@ INIT
191178autoflushSTDOUT 1;
192179autoflushSTDERR 1;
193180autoflush$testlog 1;
194-
195- # Settings to close stdin for certain commands.
196- # If IO::Pty is present, use a pseudo-terminal, so that libraries like
197- # openssl which open the tty if they think stdin isn't one for a password
198- # don't block. Elsewhere just provide an empty string for stdin.
199- if ($have_io_pty )
200- {
201- use charnames' :full' ;
202- @no_stdin = (' <pty<' , \" \N{END OF TRANSMISSION} " );
203- }
204- else
205- {
206- @no_stdin = (' <' , \" " );
207- }
208181}
209182
210183END
@@ -370,7 +343,7 @@ sub run_command
370343{
371344my ($cmd ) =@_ ;
372345my ($stdout ,$stderr );
373- my $result = IPC::Run::run$cmd ,' >' , \$stdout ,' 2>' , \$stderr , @no_stdin ;
346+ my $result = IPC::Run::run$cmd ,' >' , \$stdout ,' 2>' , \$stderr ;
374347chomp ($stdout );
375348chomp ($stderr );
376349return ($stdout ,$stderr );
@@ -603,7 +576,7 @@ sub check_pg_config
603576my ($regexp ) =@_ ;
604577my ($stdout ,$stderr );
605578my $result = IPC::Run::run [' pg_config' ,' --includedir' ],' >' ,
606- \$stdout ,' 2>' , \$stderr , @no_stdin
579+ \$stdout ,' 2>' , \$stderr
607580or die " could not execute pg_config" ;
608581chomp ($stdout );
609582$stdout =~s /\r $// ;
@@ -700,7 +673,7 @@ sub program_help_ok
700673my ($stdout ,$stderr );
701674print (" # Running:$cmd --help\n " );
702675my $result = IPC::Run::run [$cmd ,' --help' ],' >' , \$stdout ,' 2>' ,
703- \$stderr , @no_stdin ;
676+ \$stderr ;
704677ok($result ," $cmd --help exit code 0" );
705678isnt($stdout ,' ' ," $cmd --help goes to stdout" );
706679is($stderr ,' ' ," $cmd --help nothing to stderr" );
@@ -722,7 +695,7 @@ sub program_version_ok
722695my ($stdout ,$stderr );
723696print (" # Running:$cmd --version\n " );
724697my $result = IPC::Run::run [$cmd ,' --version' ],' >' , \$stdout ,' 2>' ,
725- \$stderr , @no_stdin ;
698+ \$stderr ;
726699ok($result ," $cmd --version exit code 0" );
727700isnt($stdout ,' ' ," $cmd --version goes to stdout" );
728701is($stderr ,' ' ," $cmd --version nothing to stderr" );
@@ -745,7 +718,8 @@ sub program_options_handling_ok
745718my ($stdout ,$stderr );
746719print (" # Running:$cmd --not-a-valid-option\n " );
747720my $result = IPC::Run::run [$cmd ,' --not-a-valid-option' ],' >' ,
748- \$stdout ,' 2>' , \$stderr ,@no_stdin ;
721+ \$stdout ,
722+ ' 2>' , \$stderr ;
749723ok(!$result ," $cmd with invalid option nonzero exit code" );
750724isnt($stderr ,' ' ," $cmd with invalid option prints error message" );
751725return ;
@@ -766,7 +740,7 @@ sub command_like
766740my ($cmd ,$expected_stdout ,$test_name ) =@_ ;
767741my ($stdout ,$stderr );
768742print (" # Running:" .join (" " , @{$cmd }) ." \n " );
769- my $result = IPC::Run::run$cmd ,' >' , \$stdout ,' 2>' , \$stderr , @no_stdin ;
743+ my $result = IPC::Run::run$cmd ,' >' , \$stdout ,' 2>' , \$stderr ;
770744ok($result ," $test_name : exit code 0" );
771745is($stderr ,' ' ," $test_name : no stderr" );
772746like($stdout ,$expected_stdout ," $test_name : matches" );
@@ -795,8 +769,7 @@ sub command_like_safe
795769my $stdoutfile = File::Temp-> new();
796770my $stderrfile = File::Temp-> new();
797771print (" # Running:" .join (" " , @{$cmd }) ." \n " );
798- my $result = IPC::Run::run$cmd ,' >' ,$stdoutfile ,' 2>' ,$stderrfile ,
799- @no_stdin ;
772+ my $result = IPC::Run::run$cmd ,' >' ,$stdoutfile ,' 2>' ,$stderrfile ;
800773$stdout = slurp_file($stdoutfile );
801774$stderr = slurp_file($stderrfile );
802775ok($result ," $test_name : exit code 0" );
@@ -820,7 +793,7 @@ sub command_fails_like
820793my ($cmd ,$expected_stderr ,$test_name ) =@_ ;
821794my ($stdout ,$stderr );
822795print (" # Running:" .join (" " , @{$cmd }) ." \n " );
823- my $result = IPC::Run::run$cmd ,' >' , \$stdout ,' 2>' , \$stderr , @no_stdin ;
796+ my $result = IPC::Run::run$cmd ,' >' , \$stdout ,' 2>' , \$stderr ;
824797ok(!$result ," $test_name : exit code not 0" );
825798like($stderr ,$expected_stderr ," $test_name : matches" );
826799return ;
@@ -858,7 +831,7 @@ sub command_checks_all
858831# run command
859832my ($stdout ,$stderr );
860833print (" # Running:" .join (" " , @{$cmd }) ." \n " );
861- IPC::Run::run($cmd ,' >' , \$stdout ,' 2>' , \$stderr , @no_stdin );
834+ IPC::Run::run($cmd ,' >' , \$stdout ,' 2>' , \$stderr );
862835
863836# See http://perldoc.perl.org/perlvar.html#%24CHILD_ERROR
864837my $ret =$? ;