From e458365ff2eeb837ce2e20eac513a514e6b76c80 Mon Sep 17 00:00:00 2001 From: "cltbld%netscape.com" Date: Thu, 8 Aug 2002 02:44:54 +0000 Subject: [PATCH] LayoutTest is now a function in TinderUtils, so that build-chimera.pl can reuse the code. -mcafee --- tools/tinderbox/build-chimera.pl | 78 ++---------- tools/tinderbox/build-seamonkey-util.pl | 151 ++++++++++++------------ 2 files changed, 84 insertions(+), 145 deletions(-) diff --git a/tools/tinderbox/build-chimera.pl b/tools/tinderbox/build-chimera.pl index 17ce1b3a0814..ec7811dbd160 100644 --- a/tools/tinderbox/build-chimera.pl +++ b/tools/tinderbox/build-chimera.pl @@ -53,8 +53,8 @@ sub main { # Control tests from here, sorry no config file yet. my $chimera_alive_test = 1; my $chimera_test8_test = 1; - my $chimera_startup_test = 0; - my $chimera_layout_performance_test = 0; + my $chimera_startup_test = 1; + my $chimera_layout_performance_test = 1; my $chimera_clean_profile = 1; @@ -235,76 +235,12 @@ sub main { # Pageload test. if ($chimera_layout_performance_test and $post_status eq 'success') { - my $layout_time; - my $test_name = "ChimeraLayoutPerformanceTest"; - my $binary_log = "$test_name.log"; - - $layout_time = - TinderUtils::AliveTestReturnToken($test_name, - "$chimera_dir/build/Navigator.app/Contents/MacOS", - "Navigator", - "-url \"http://$Settings::pageload_server/page-loader/loader.pl?delay=1000&nocache=0&maxcyc=4&timeout=15000&auto=1\"", - 800, - "_x_x_mozilla_page_load", - ","); - - if($layout_time) { - chomp($layout_time); - my @times = split(',', $layout_time); - $layout_time = $times[0]; # Set layout time to first number that we scraped. - - } else { - TinderUtils::print_log "TinderboxPrint:Tp:[CRASH]\n"; - - # Run the test a second time. Getting intermittent crashes, these - # are expensive to wait, a 2nd run that is successful is still useful. - # Sorry for the cut & paste. -mcafee - - $layout_time = - TinderUtils::AliveTestReturnToken($test_name, - "$chimera_dir/build/Navigator.app/Contents/MacOS", - "Navigator", - "-url \"http://$Settings::pageload_server/page-loader/loader.pl?delay=1000&nocache=0&maxcyc=4&timeout=15000&auto=1\"", - 800, - "_x_x_mozilla_page_load", - ","); - - if($layout_time) { - chomp($layout_time); - my @times = split(',', $layout_time); - $layout_time = $times[0]; # Set layout time to first number that we scraped. - } else { - # Print failure message if we fail 2nd time. - TinderUtils::print_log "TinderboxPrint:Tp:[CRASH]\n"; - } - } - - # Set test status. - if($layout_time) { - $post_status = 'success'; - } else { - $post_status = 'testfailed'; - } - - - if($post_status eq 'success') { - my $time = POSIX::strftime "%Y:%m:%d:%H:%M:%S", localtime; - - TinderUtils::print_log "TinderboxPrint:" . - "Tp:$layout_time" . "ms\n"; - - # Pull out detail data from log. - my $cwd = TinderUtils::get_system_cwd(); - print "cwd = $cwd\n"; - my $raw_data = TinderUtils::extract_token_from_file("$chimera_dir/build/Navigator.app/Contents/MacOS/$binary_log", "_x_x_mozilla_page_load_details", ","); - chomp($raw_data); - - if($Settings::TestsPhoneHome) { - TinderUtils::send_results_to_server($layout_time, $raw_data, "pageload", ::hostname()); - } - } + $post_status = + TinderUtils::LayoutPerformanceTest("ChimeraLayoutPerformanceTest", + "Navigator", + "$chimera_dir/build/Navigator.app/Contents/MacOS", + "-url"); } diff --git a/tools/tinderbox/build-seamonkey-util.pl b/tools/tinderbox/build-seamonkey-util.pl index 70ea4308d1c8..d3bdcd5cb085 100644 --- a/tools/tinderbox/build-seamonkey-util.pl +++ b/tools/tinderbox/build-seamonkey-util.pl @@ -22,7 +22,7 @@ use File::Path; # for rmtree(); use Config; # for $Config{sig_name} and $Config{sig_num} use File::Find (); -$::UtilsVersion = '$Revision: 1.176 $ '; +$::UtilsVersion = '$Revision: 1.177 $ '; package TinderUtils; @@ -1525,79 +1525,10 @@ sub run_all_tests { # Layout performance test. if ($Settings::LayoutPerformanceTest and $test_result eq 'success') { - my $layout_time; - my $layout_time_details; - my $test_name = "LayoutPerformanceTest"; - my $binary_log = "$build_dir/$test_name.log"; - my $url = "http://$Settings::pageload_server/page-loader/loader.pl?delay=1000&nocache=0&maxcyc=4&timeout=$Settings::LayoutPerformanceTestPageTimeout&auto=1"; - - # Settle OS. - run_system_cmd("sync; sleep 10", 35); - - $layout_time = AliveTestReturnToken($test_name, - $build_dir, - $binary, - " -P $Settings::MozProfileName \"$url\"", - $Settings::LayoutPerformanceTestTimeout, - "_x_x_mozilla_page_load", - ","); - - if($layout_time) { - # Pick off first number. - chomp($layout_time); - my @times = split(',', $layout_time); - $layout_time = $times[0]; # Set layout time to first number that we scraped. - - - - } else { - print_log "TinderboxPrint:Tp:[CRASH]\n"; - - # Run the test a second time. Getting intermittent crashes, these - # are expensive to wait, a 2nd run that is successful is still useful. - # Sorry for the cut & paste. -mcafee - - $layout_time = AliveTestReturnToken($test_name, - $build_dir, - $binary, - " -P $Settings::MozProfileName \"$url\"", - $Settings::LayoutPerformanceTestTimeout, - "_x_x_mozilla_page_load", - ","); - - # Print failure message if we fail 2nd time. - unless($layout_time) { - print_log "TinderboxPrint:Tp:[CRASH]\n"; - } else { - # Pick off first number. - chomp($layout_time); - my @times = split(',', $layout_time); - $layout_time = $times[0]; # Set layout time to first number that we scraped. - } - } - - # Set test status. - if($layout_time) { - $test_result = 'success'; - } else { - $test_result = 'testfailed'; - } - - if($test_result eq 'success') { - my $time = POSIX::strftime "%Y:%m:%d:%H:%M:%S", localtime; - - print_log "TinderboxPrint:" . - "Tp:$layout_time" . "ms\n"; - - # Pull out detail data from log. - my $raw_data = extract_token_from_file($binary_log, "_x_x_mozilla_page_load_details", ","); - chomp($raw_data); - - if($Settings::TestsPhoneHome) { - send_results_to_server($layout_time, $raw_data, "pageload", ::hostname()); - } - } + $test_result = LayoutPerformanceTest("LayoutPerformanceTest", + $binary, + $build_dir, + "-P $Settings::MozProfileName"); } @@ -1881,7 +1812,79 @@ sub FileBasedTest { } # FileBasedTest +sub LayoutPerformanceTest { + my ($test_name, $binary, $build_dir, $layout_test_args) = @_; + my $layout_test_result; + my $layout_time; + my $layout_time_details; + my $binary_log = "$build_dir/$test_name.log"; + my $url = "http://$Settings::pageload_server/page-loader/loader.pl?delay=1000&nocache=0&maxcyc=4&timeout=$Settings::LayoutPerformanceTestPageTimeout&auto=1"; + + # Settle OS. + run_system_cmd("sync; sleep 10", 35); + + $layout_time = AliveTestReturnToken($test_name, + $build_dir, + $binary, + " $layout_test_args \"$url\"", + $Settings::LayoutPerformanceTestTimeout, + "_x_x_mozilla_page_load", + ","); + + if($layout_time) { + chomp($layout_time); + my @times = split(',', $layout_time); + $layout_time = $times[0]; # Set layout time to first number. + } else { + print_log "TinderboxPrint:Tp:[CRASH]\n"; + + # Run the test a second time. Getting intermittent crashes, these + # are expensive to wait, a 2nd run that is successful is still useful. + # Sorry for the cut & paste. -mcafee + + $layout_time = AliveTestReturnToken($test_name, + $build_dir, + $binary, + " $layout_test_args \"$url\"", + $Settings::LayoutPerformanceTestTimeout, + "_x_x_mozilla_page_load", + ","); + + # Print failure message if we fail 2nd time. + unless($layout_time) { + print_log "TinderboxPrint:Tp:[CRASH]\n"; + } else { + chomp($layout_time); + my @times = split(',', $layout_time); + $layout_time = $times[0]; # Set layout time to first number. + } + } + + # Set test status. + if($layout_time) { + $layout_test_result = 'success'; + } else { + $layout_test_result = 'testfailed'; + } + + if($layout_test_result eq 'success') { + my $time = POSIX::strftime "%Y:%m:%d:%H:%M:%S", localtime; + + print_log "TinderboxPrint:" . + "Tp:$layout_time" . "ms\n"; + + # Pull out detail data from log. + my $raw_data = extract_token_from_file($binary_log, "_x_x_mozilla_page_load_details", ","); + chomp($raw_data); + + if($Settings::TestsPhoneHome) { + send_results_to_server($layout_time, $raw_data, "pageload", ::hostname()); + } + } + return $layout_test_result; +} # Page loader/cycling mechanism (mozilla -f option):