From a60936fdae3f510a9acdf48123af5dd404f7b98e Mon Sep 17 00:00:00 2001 From: "leaf%mozilla.org" Date: Wed, 30 Jun 1999 00:29:09 +0000 Subject: [PATCH] getting this back on its feet, letting it run with relative paths git-svn-id: svn://10.0.0.236/trunk@37503 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/tools/tests/unix/smoke.pl | 38 +++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/mozilla/tools/tests/unix/smoke.pl b/mozilla/tools/tests/unix/smoke.pl index 8001d3a00c6..f1f4e0b3343 100644 --- a/mozilla/tools/tests/unix/smoke.pl +++ b/mozilla/tools/tests/unix/smoke.pl @@ -13,22 +13,32 @@ $test_duration = 120; # seconds before i deem this url timed out # paths, so we need to get the pwd and replace 'tools/tests/unix' # with 'dist/bin' -- then we're golden. #$apprunner_bin = '/u/phillip/seamonkey/linux/package'; + + +chop($start_dir = `pwd`); $apprunner_bin = '../../../dist/bin'; +chdir($apprunner_bin); + +# need the absolute path, not the relative one +chop($apprunner_bin = `pwd`); + #nothing else needs to be changed $apprunner = "$apprunner_bin/apprunner"; $apprunner_samples = "$apprunner_bin/res/samples"; -$apprunner_log = 'smoketest.log'; -#$mail_log = '/tmp/maillog.txt'; +$apprunner_log = $start_dir . '/smoketest.log'; +#$mail_log = '/tmp/maillog.txt'; +#open (LOG_FILE, ">> $apprunner_log"); +#print LOG_FILE "Starting directory is $start_dir \n"; +#print LOG_FULE "apprunner binary is $apprunner \n"; +#print LOG_FULE "Samples directory is $apprunner_samples \n"; +#close (LOG_FILE); # we fork and launch apprunner in a few spots around here, so let's define # this just once: $ENV{'MOZILLA_FIVE_HOME'}="$apprunner_bin"; $ENV{'LD_LIBRARY_PATH'}="/usr/lib:/lib:$apprunner_bin"; - -cwd $apprunner_bin; - # here are a few subroutines we use: # get_build_date - look through navigator.xul for the build id (1999-04-18-08) # returns the string @@ -94,7 +104,7 @@ sub main { print (REPORT_FILE "\n"); &get_url_list; - + my $i; my $style; @@ -198,17 +208,24 @@ sub test_url { ## loads a doc successfully or unsuccessfully, or ## until the reaperchild kills apprunner open STATUS, "$apprunner $url 2>&1 |"; + open LOG_FILE, ">> $apprunner_log"; LOG_FILE->autoflush(); unless ($url eq ""){ print LOG_FILE "testing url: $url\n" } while (){ print LOG_FILE; # Document: Done (7.918 secs) - if (/Document: Done \((..*) secs/) { + if (/Document: Done \((\d*\.\d*) secs/) { $run_time = $1; + last; # we can quit if we get a Document: Done message } - last if (/loaded successfully/); + if (/loaded successfully/) { + if ($run_time eq 'E2-FAILED') { + $run_time = -1 ; + } + last; # we can quit if we get a loaded successfully message + } $run_time = 'E3-FAILED' and last if (/Error loading URL/); } @@ -243,6 +260,7 @@ sub test_url { sleep 1 && print "."; } print "don't fear the reaper, man\n" and sleep 1; + # yuck. killall is very bad for solaris. system ("killall -9 apprunner"); system ("echo timeout > timeout.txt"); exit 0; @@ -284,7 +302,7 @@ sub get_build_date { } } close( XUL_FILE ); - $BuildNo =~ s/["<>]/ /g; + $BuildNo =~ s/[<>]/ /g; return $BuildNo; } @@ -293,7 +311,7 @@ sub get_build_date { # get_url_list -- opens the $url file and loads up all the urls. ################################################################ sub get_url_list { - local $url = shift || "url.txt"; + local $url = shift || $start_dir . "/url.txt"; my $i = 0; open (URL_FILE, "< $url");