#!/usr/bin/perl # # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language governing rights and limitations under the # License. # # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Sun Microsystems, Inc. # Portions created by the Initial Developer are Copyright (C) 1999 # the Initial Developer. All Rights Reserved. # # Contributor(s): # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), # in which case the provisions of the GPL or the LGPL are applicable instead # of those above. If you wish to allow use of your version of this file only # under the terms of either the GPL or the LGPL, and not to allow others to # use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under # the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** # Created By: Raju Pallath # Creation Date: Aug 2nd 1999 # # Ported by: Konstantin S. Ermakov # Ported date: Aug 24th 1999 # # This script is used to invoke all test case for OJI API # through apprunner and to recored their results # # # Attach Perl Libraries ################################################################### use POSIX ":sys_wait_h"; #used by waitpid use Cwd; use File::Copy; #use Win32::Process; #use IO::Handle; ################################################################### ######################## # # # User's settings # # # ######################## #Mozilla's executable $MOZILLA_EXECUTABLE="mozilla-bin"; if ($^O =~ /Win32/i) { $MOZILLA_EXECUTABLE="mozilla.exe"; } #sometimes we need to specify additional parameters for mozilla $ADDITIONAL_PARAMETERS="-P default"; # time in seconds after which the apprunner has to be killed. # by default the apprunner will be up for so much time regardless of # whether over or not. User can either decrease it or increase it. # $DELAY_FACTOR = 50; $FULL_TEST_LIST="OJITestsList.lst"; $TEST_RESULTS="OJITestResults.txt"; $TEST_DESCRIPTIONS="../OJIAPITestsDescr.html"; $TARGET_WINDOW="Test Descriptions"; $curdir = cwd(); $DEFAULT_TEST_URL="file:///$curdir"; # time period in seconds of periodically checking: is the apprunner still alive $DELAY_OF_CYCLE = 1; ############################################################## ############################################################## ############################################################## $DOCROOT = $ENV{"TEST_URL"} ? $ENV{"TEST_URL"} : $DEFAULT_TEST_URL; # delimiter for logfile $delimiter="###################################################\n"; $nosort=0; ################################################################## # Usage ################################################################## sub usage() { print "\n"; print "##################################################################\n"; print " perl autorun.pl [ -help ] [ -genhtml [ ALL/PASS/FAILED/ ] ] [ -compare [ ] ] [ -t ]\n"; print "\n"; print " -help This message.\n\n"; print " -compare \n"; print " Compares two test result files and generates the diff files\n"; print " the resulting diff files in text (.txt)\n"; print " and HTML (.html) formats\n"; print " files to be compared (optional parameters)\n"; print " should contain test results in text format\n"; print " (generated by autorun.pl as BWTest.txt);\n"; print " if ommited the default values are used: \n"; print " => log/BWTest.txt \n"; print " => log/BWTest.txt.bak \n\n"; print " -genhtml