From d0825bca7fe65beaee391d30da42e937db621564 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 2 Feb 2010 14:57:50 +0000 Subject: Merge webkit.org at r54127 : Initial merge by git Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82 --- WebKitTools/Scripts/run-webkit-httpd | 53 +++++------------------------------- 1 file changed, 7 insertions(+), 46 deletions(-) (limited to 'WebKitTools/Scripts/run-webkit-httpd') diff --git a/WebKitTools/Scripts/run-webkit-httpd b/WebKitTools/Scripts/run-webkit-httpd index 9a97190..018f64c 100755 --- a/WebKitTools/Scripts/run-webkit-httpd +++ b/WebKitTools/Scripts/run-webkit-httpd @@ -33,11 +33,13 @@ use strict; use warnings; use Cwd; +use File::Path; use File::Basename; use Getopt::Long; use FindBin; use lib $FindBin::Bin; +use webkitperl::httpd; use webkitdirs; # Argument handling @@ -62,39 +64,7 @@ if (!$result || @ARGV || $showHelp) { setConfiguration(); my $productDir = productDir(); chdirWebKit(); - -mkdir "/tmp/WebKit"; - -if (-f "/tmp/WebKit/httpd.pid") { - my $oldPid = `cat /tmp/WebKit/httpd.pid`; - chomp $oldPid; - if (0 != kill 0, $oldPid) { - print "\nhttpd is already running: pid $oldPid, killing...\n"; - kill 15, $oldPid; - - my $retryCount = 20; - while ((0 != kill 0, $oldPid) && $retryCount) { - sleep 1; - --$retryCount; - } - - die "Timed out waiting for httpd to quit" unless $retryCount; - } -} - -my $testDirectory = getcwd() . "/LayoutTests"; -my $jsTestResourcesDirectory = $testDirectory . "/fast/js/resources"; -my $httpdPath = "/usr/sbin/httpd"; -$httpdPath = "/usr/sbin/apache2" if isDebianBased(); -my $httpdConfig = "$testDirectory/http/conf/httpd.conf"; -$httpdConfig = "$testDirectory/http/conf/cygwin-httpd.conf" if isCygwin(); -$httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|; -$httpdConfig = "$testDirectory/http/conf/apache2-debian-httpd.conf" if isDebianBased(); -$httpdConfig = "$testDirectory/http/conf/fedora-httpd.conf" if isFedoraBased(); -my $documentRoot = "$testDirectory/http/tests"; -my $typesConfig = "$testDirectory/http/conf/mime.types"; -my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem"; - +my $testDirectory = File::Spec->catfile(getcwd(), "LayoutTests"); my $listen = "127.0.0.1:$httpdPort"; $listen = "$httpdPort" if ($allInterfaces); @@ -103,19 +73,13 @@ if ($allInterfaces) { } else { print "Starting httpd on ...\n"; } +setShouldWaitForUserInterrupt(); print "Press Ctrl+C to stop it.\n\n"; my @args = ( - "-f", "$httpdConfig", - "-C", "DocumentRoot \"$documentRoot\"", - # Setup a link to where the js test templates are stored, use -c so that mod_alias will already be laoded. - "-c", "Alias /js-test-resources \"$jsTestResourcesDirectory\"", "-C", "Listen $listen", - "-c", "TypesConfig \"$typesConfig\"", "-c", "CustomLog |/usr/bin/tee common", "-c", "ErrorLog |/usr/bin/tee", - # Apache wouldn't run CGIs with permissions==700 otherwise. - "-c", "User \"#$<\"", # Run in single-process mode, do not detach from the controlling terminal. "-X", # Disable Keep-Alive support. Makes testing in multiple browsers easier (no need to wait @@ -123,9 +87,6 @@ my @args = ( "-c", "KeepAlive 0" ); -# FIXME: Enable this on Windows once is fixed -push(@args, "-c", "SSLCertificateFile \"$sslCertificate\"") unless isCygwin(); - -system($httpdPath, @args); - -unlink "/tmp/WebKit/httpd.pid"; +my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory); +@args = (@defaultArgs, @args); +openHTTPD(@args); -- cgit v1.1