Make run-iexploder-tests work on Linux.
authorabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Feb 2010 09:51:33 +0000 (09:51 +0000)
committerabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Feb 2010 09:51:33 +0000 (09:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=34748

Reviewed by Adam Barth.

Extract the platform dependant Apache configuration checking code in httpd.pm to a separate function
called getHTTPDConfigPathForTestDirectory and use run-launcher instead of run-safari if run on Linux.

* Scripts/run-iexploder-tests:
* Scripts/webkitperl/httpd.pm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@54590 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/run-iexploder-tests
WebKitTools/Scripts/webkitperl/httpd.pm

index cdae8d5..369a946 100644 (file)
@@ -1,3 +1,16 @@
+2010-02-10  Andras Becsi  <abecsi@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Make run-iexploder-tests work on Linux.
+        https://bugs.webkit.org/show_bug.cgi?id=34748
+
+        Extract the platform dependant Apache configuration checking code in httpd.pm to a separate function
+        called getHTTPDConfigPathForTestDirectory and use run-launcher instead of run-safari if run on Linux.
+
+        * Scripts/run-iexploder-tests:
+        * Scripts/webkitperl/httpd.pm:
+
 2010-02-09  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt] Unreviewed. Roll-out r54543, because layout tests crash in debug mode.
index 1b3976f..7f2f04f 100755 (executable)
@@ -101,9 +101,13 @@ sub runSafariWithIExploder()
     print REDIRECT_HTML "</html>\n";
     close REDIRECT_HTML;
     
-    local %ENV;
-    $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
-    system "WebKitTools/Scripts/run-safari", "-NSOpen", "$iExploderTestDirectory/redirect.html";
+    if (!isAppleWebKit()) {
+        system "WebKitTools/Scripts/run-launcher", "$iExploderTestDirectory/redirect.html";
+    } else {
+        local %ENV;
+        $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
+        system "WebKitTools/Scripts/run-safari", "-NSOpen", "$iExploderTestDirectory/redirect.html";
+    }
 }
 
 sub configureAndOpenHTTPDIfNeeded()
@@ -114,8 +118,9 @@ sub configureAndOpenHTTPDIfNeeded()
     my $webkitDirectory = getcwd();
     my $testDirectory = $webkitDirectory . "/LayoutTests";
     my $iExploderDirectory = $webkitDirectory . "/WebKitTools/iExploder";
-    my $httpdConfig = "$testDirectory/http/conf/httpd.conf";
-    $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+
+    my $httpdConfig = getHTTPDConfigPathForTestDirectory($testDirectory);
+
     my $documentRoot = "$iExploderDirectory/htdocs";
     my $typesConfig = "$testDirectory/http/conf/mime.types";
     my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
index b362e51..05eb21c 100644 (file)
@@ -44,7 +44,14 @@ BEGIN {
    our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
    $VERSION     = 1.00;
    @ISA         = qw(Exporter);
-   @EXPORT      = qw(&getHTTPDPath &getDefaultConfigForTestDirectory &openHTTPD &closeHTTPD &setShouldWaitForUserInterrupt &waitForHTTPDLock &getWaitTime);
+   @EXPORT      = qw(&getHTTPDPath
+                     &getHTTPDConfigPathForTestDirectory
+                     &getDefaultConfigForTestDirectory
+                     &openHTTPD
+                     &closeHTTPD
+                     &setShouldWaitForUserInterrupt
+                     &waitForHTTPDLock
+                     &getWaitTime);
    %EXPORT_TAGS = ( );
    @EXPORT_OK   = ();
 }
@@ -79,24 +86,7 @@ sub getDefaultConfigForTestDirectory
     my ($testDirectory) = @_;
     die "No test directory has been specified." unless ($testDirectory);
 
-    my $httpdConfig;
-    getHTTPDPath();
-    if (isCygwin()) {
-        my $windowsConfDirectory = "$testDirectory/http/conf/";
-        unless (-x "/usr/lib/apache/libphp4.dll") {
-            copy("$windowsConfDirectory/libphp4.dll", "/usr/lib/apache/libphp4.dll");
-            chmod(0755, "/usr/lib/apache/libphp4.dll");
-        }
-        $httpdConfig = "$windowsConfDirectory/cygwin-httpd.conf";
-    } elsif (isDebianBased()) {
-        $httpdConfig = "$testDirectory/http/conf/apache2-debian-httpd.conf";
-    } elsif (isFedoraBased()) {
-        $httpdConfig = "$testDirectory/http/conf/fedora-httpd.conf";
-    } else {
-        $httpdConfig = "$testDirectory/http/conf/httpd.conf";
-        $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
-    }
-
+    my $httpdConfig = getHTTPDConfigPathForTestDirectory($testDirectory);
     my $documentRoot = "$testDirectory/http/tests";
     my $jsTestResourcesDirectory = $testDirectory . "/fast/js/resources";
     my $typesConfig = "$testDirectory/http/conf/mime.types";
@@ -125,6 +115,30 @@ sub getDefaultConfigForTestDirectory
 
 }
 
+sub getHTTPDConfigPathForTestDirectory
+{
+    my ($testDirectory) = @_;
+    die "No test directory has been specified." unless ($testDirectory);
+    my $httpdConfig;
+    getHTTPDPath();
+    if (isCygwin()) {
+        my $windowsConfDirectory = "$testDirectory/http/conf/";
+        unless (-x "/usr/lib/apache/libphp4.dll") {
+            copy("$windowsConfDirectory/libphp4.dll", "/usr/lib/apache/libphp4.dll");
+            chmod(0755, "/usr/lib/apache/libphp4.dll");
+        }
+        $httpdConfig = "$windowsConfDirectory/cygwin-httpd.conf";
+    } elsif (isDebianBased()) {
+        $httpdConfig = "$testDirectory/http/conf/apache2-debian-httpd.conf";
+    } elsif (isFedoraBased()) {
+        $httpdConfig = "$testDirectory/http/conf/fedora-httpd.conf";
+    } else {
+        $httpdConfig = "$testDirectory/http/conf/httpd.conf";
+        $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+    }
+    return $httpdConfig;
+}
+
 sub openHTTPD(@)
 {
     my (@args) = @_;