@@ -21,7 +21,6 @@ TestLib - helper module for writing PostgreSQL's C<prove> tests.
21
21
22
22
# Miscellanea
23
23
print "on Windows" if $TestLib::windows_os;
24
- print "IO::Pty is available" if $TestLib::have_io_pty;
25
24
my $path = TestLib::perl2host($backup_dir);
26
25
ok(check_mode_recursive($stream_dir, 0700, 0600),
27
26
"check stream dir permissions");
@@ -84,12 +83,9 @@ our @EXPORT = qw(
84
83
command_checks_all
85
84
86
85
$windows_os
87
- $have_io_pty
88
86
) ;
89
87
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 );
93
89
94
90
BEGIN
95
91
{
@@ -121,9 +117,6 @@ BEGIN
121
117
require Win32API::File;
122
118
Win32API::File-> import (qw( createFile OsFHandleOpen CloseHandle) );
123
119
}
124
-
125
- eval { require IO::Pty; };
126
- $have_io_pty = 1 unless $@ ;
127
120
}
128
121
129
122
=pod
@@ -138,12 +131,6 @@ Set to true when running under Windows, except on Cygwin.
138
131
139
132
=back
140
133
141
- =item C<$have_io_pty >
142
-
143
- Set to true when IO::Pty is available.
144
-
145
- =back
146
-
147
134
=cut
148
135
149
136
INIT
@@ -191,20 +178,6 @@ INIT
191
178
autoflush STDOUT 1;
192
179
autoflush STDERR 1;
193
180
autoflush $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
- }
208
181
}
209
182
210
183
END
@@ -370,7 +343,7 @@ sub run_command
370
343
{
371
344
my ($cmd ) = @_ ;
372
345
my ($stdout , $stderr );
373
- my $result = IPC::Run::run $cmd , ' >' , \$stdout , ' 2>' , \$stderr , @no_stdin ;
346
+ my $result = IPC::Run::run $cmd , ' >' , \$stdout , ' 2>' , \$stderr ;
374
347
chomp ($stdout );
375
348
chomp ($stderr );
376
349
return ($stdout , $stderr );
@@ -603,7 +576,7 @@ sub check_pg_config
603
576
my ($regexp ) = @_ ;
604
577
my ($stdout , $stderr );
605
578
my $result = IPC::Run::run [ ' pg_config' , ' --includedir' ], ' >' ,
606
- \$stdout , ' 2>' , \$stderr , @no_stdin
579
+ \$stdout , ' 2>' , \$stderr
607
580
or die " could not execute pg_config" ;
608
581
chomp ($stdout );
609
582
$stdout =~ s /\r $// ;
@@ -700,7 +673,7 @@ sub program_help_ok
700
673
my ($stdout , $stderr );
701
674
print (" # Running: $cmd --help\n " );
702
675
my $result = IPC::Run::run [ $cmd , ' --help' ], ' >' , \$stdout , ' 2>' ,
703
- \$stderr , @no_stdin ;
676
+ \$stderr ;
704
677
ok($result , " $cmd --help exit code 0" );
705
678
isnt($stdout , ' ' , " $cmd --help goes to stdout" );
706
679
is($stderr , ' ' , " $cmd --help nothing to stderr" );
@@ -722,7 +695,7 @@ sub program_version_ok
722
695
my ($stdout , $stderr );
723
696
print (" # Running: $cmd --version\n " );
724
697
my $result = IPC::Run::run [ $cmd , ' --version' ], ' >' , \$stdout , ' 2>' ,
725
- \$stderr , @no_stdin ;
698
+ \$stderr ;
726
699
ok($result , " $cmd --version exit code 0" );
727
700
isnt($stdout , ' ' , " $cmd --version goes to stdout" );
728
701
is($stderr , ' ' , " $cmd --version nothing to stderr" );
@@ -745,7 +718,8 @@ sub program_options_handling_ok
745
718
my ($stdout , $stderr );
746
719
print (" # Running: $cmd --not-a-valid-option\n " );
747
720
my $result = IPC::Run::run [ $cmd , ' --not-a-valid-option' ], ' >' ,
748
- \$stdout , ' 2>' , \$stderr , @no_stdin ;
721
+ \$stdout ,
722
+ ' 2>' , \$stderr ;
749
723
ok(!$result , " $cmd with invalid option nonzero exit code" );
750
724
isnt($stderr , ' ' , " $cmd with invalid option prints error message" );
751
725
return ;
@@ -766,7 +740,7 @@ sub command_like
766
740
my ($cmd , $expected_stdout , $test_name ) = @_ ;
767
741
my ($stdout , $stderr );
768
742
print (" # 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 ;
770
744
ok($result , " $test_name : exit code 0" );
771
745
is($stderr , ' ' , " $test_name : no stderr" );
772
746
like($stdout , $expected_stdout , " $test_name : matches" );
@@ -795,8 +769,7 @@ sub command_like_safe
795
769
my $stdoutfile = File::Temp-> new();
796
770
my $stderrfile = File::Temp-> new();
797
771
print (" # 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 ;
800
773
$stdout = slurp_file($stdoutfile );
801
774
$stderr = slurp_file($stderrfile );
802
775
ok($result , " $test_name : exit code 0" );
@@ -820,7 +793,7 @@ sub command_fails_like
820
793
my ($cmd , $expected_stderr , $test_name ) = @_ ;
821
794
my ($stdout , $stderr );
822
795
print (" # 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 ;
824
797
ok(!$result , " $test_name : exit code not 0" );
825
798
like($stderr , $expected_stderr , " $test_name : matches" );
826
799
return ;
@@ -858,7 +831,7 @@ sub command_checks_all
858
831
# run command
859
832
my ($stdout , $stderr );
860
833
print (" # Running: " . join (" " , @{$cmd }) . " \n " );
861
- IPC::Run::run($cmd , ' >' , \$stdout , ' 2>' , \$stderr , @no_stdin );
834
+ IPC::Run::run($cmd , ' >' , \$stdout , ' 2>' , \$stderr );
862
835
863
836
# See http://perldoc.perl.org/perlvar.html#%24CHILD_ERROR
864
837
my $ret = $? ;
0 commit comments