Changeset 17747
- Timestamp:
- 08/17/08 11:33:31 (5 years ago)
- Files:
-
- 1 modified
-
lang/perl/HTTP-Engine/trunk/t/FCGIUtils.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-Engine/trunk/t/FCGIUtils.pm
r17384 r17747 17 17 18 18 sub test_lighty ($&) { 19 my ($fcgisrc, $callback) = @_; 19 my ($fcgisrc, $callback, $port) = @_; 20 $port ||= empty_port; 20 21 21 22 plan skip_all => 'set TEST_LIGHTTPD to enable this test' … … 32 33 33 34 my $tmpdir = File::Temp::tempdir(); 34 my $port = empty_port;35 35 36 my ($fcgifh, $fcgifname) = File::Temp::tempfile(); 37 print {$fcgifh} $fcgisrc; 38 close $fcgifh; 39 chmod 0777, $fcgifname; 36 my $fcgifname = File::Spec->catfile($tmpdir, "test.fcgi"); 37 do { 38 _write_file($fcgifname => $fcgisrc); 39 chmod 0777, $fcgifname; 40 warn `perl -wc $fcgifname` if $ENV{DEBUG}; 41 }; 40 42 41 43 my $conf = <<"END"; … … 73 75 END 74 76 75 my ($conffh, $confname) = File::Temp::tempfile(); 76 print {$conffh} $conf or die "Write error: $!"; 77 close $conffh; 77 my $conffname = File::Spec->catfile($tmpdir, "lighty.conf"); 78 _write_file($conffname => $conf); 78 79 79 my $pid = open my $lighttpd, "$lighttpd_bin -D -f $conf name 2>&1 |"80 my $pid = open my $lighttpd, "$lighttpd_bin -D -f $conffname 2>&1 |" 80 81 or die "Unable to spawn lighttpd: $!"; 81 82 … … 84 85 $callback->($port); 85 86 87 warn `cat $tmpdir/error.log` if $ENV{DEBUG}; 88 86 89 kill 'INT', $pid; 87 90 close $lighttpd; 88 91 } 89 92 93 sub _write_file { 94 my ($fname, $src) = @_; 95 open my $fh, '>', $fname or die $!; 96 print {$fh} $src or die $!; 97 close $fh; 98 } 99 90 100 1;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)