#!/bin/csh # @OPENGROUP_COPYRIGHT@ # COPYRIGHT NOTICE # Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc. # Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group # ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for # the full copyright text. # # This software is subject to an open license. It may only be # used on, with or for operating systems which are themselves open # source systems. You must contact The Open Group for a license # allowing distribution and sublicensing of this software on, with, # or for operating systems which are not Open Source programs. # # See http://www.opengroup.org/openmotif/license for full # details of the license agreement. Any use, reproduction, or # distribution of the program constitutes recipient's acceptance of # this agreement. # # EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS # PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY # WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY # OR FITNESS FOR A PARTICULAR PURPOSE # # EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT # NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE # EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGES. # # HISTORY # # RUN.smoke # # Script to run nightly smoke tests # # a known restriction of this script is that the arguments to -xrm (or # any other flag!) must contain no spaces. # # XFILESEARCHPATH mechanism for using the defaults file in each directory. # First check to see if the variable is already set. If it is, save it. # The, set XFILESEARCHPATH to $cwd/$cwd:t.defaults. # printenv XFILESEARCHPATH if ($status == 0) then Storepath = $XFILESEARCHPATH pathExists = true endif setenv XFILESEARCHPATH $cwd/$cwd:t.defaults # default vars # The following are report generation related RUN variables. # The format for specifying will be as follows: # # RUN.smoke -genrep # -Dir - Generates a directory level report # -test - Generates a test level report # -panel - Generates a panel level report # # setenv AUTOVPATH /net/pmin11/u1/automation/output/1.2.1/Toolkit/config set tests_to_run = "" set Reportrun = false set reportInfo = "-dir" set argcnt = $#argv set argindex = 1 set in_list = "0" while ($argcnt != 0) switch ($argv[$argindex]) case -d*: @ argcnt-- @ argindex++ setenv DISPLAY $argv[$argindex] set in_list = "0" breaksw case -genrep: set Reportrun = true set argv[$argindex] = "" @ argcnt-- @ argindex++ set reportInfo = $argv[$argindex] set argv[$argindex] = "" set in_list = "0" breaksw case -list*: set argv[$argindex] = "" set in_list = "1" breaksw case *: if ( "$in_list" == "1" ) then set tests_to_run = "$tests_to_run $argv[$argindex]" set argv[$argindex] = "" endif breaksw endsw @ argcnt-- @ argindex++ end #echo "Tests2run " $tests_to_run if ("$tests_to_run" == "") then echo "Usage: RUN.smoke -list [-d ] [-genrep ]" exit 1 endif set arglist = "$argv" # clean up from previous runs if (-e ./RUN.smoke.failures) then echo "backing up RUN.smoke.failures file" mv RUN.smoke.failures RUN.smoke.failures.bak endif touch RUN.smoke.failures if (-e ./RUN.smoke.output) then echo "backing up output file" mv RUN.smoke.output RUN.smoke.output.bak endif touch RUN.smoke.output rm -f core # set the path so that scripts for report generation can be read set path = (/project/motif/qa/qauser/qatools/auto_rep $path) # noglob is needed to handle special cases set noglob # special cases. Specify ALL flags for tests which require them. # remember all arguments MUST be a single word (ie no spaces) # use single quotes around the right side. foreach test ($tests_to_run) #echo "Current test " $test set test =($test) #echo "Current test1 " $test foreach word ($test) if ($?name_flag) then set test_output = $word unset name_flag endif if ("$word" =~ "-O") then set name_flag = 1 endif end echo "" >> RUN.smoke.output echo "Beginning test " $test[1] >> RUN.smoke.output echo "Beginning test " $test[1] if ($?test_output) then echo "Output redirected to " $test_output echo "Output redirected to " $test_output >> RUN.smoke.output endif # try to prevent the script from quitting if the test wasn't built if (-e $test[1]) then echo "Running " $test $arglist $test $arglist if ($status != 0) then if (-e core) then echo "backing up core to "$test[1]".core" mv core $test[1].core endif echo "failure in test: "$test[1] >> RUN.smoke.failures echo "FAILURE IN TEST: "$test[1] >> RUN.smoke.output echo "FAILURE IN TEST: "$test[1] endif else echo "Error - Test " $test " does not exist." echo "Error - Test " $test " does not exist" >> RUN.smoke.output echo "FAILURE IN TEST: "$test[1] >> RUN.smoke.output echo "FAILURE IN TEST: "$test[1] continue endif echo "Ending test "$test[1]"" >> RUN.smoke.output echo "" >> RUN.smoke.output echo "Ending test "$test[1]"" echo "" unset test_output end unset noglob echo "Automated run of directory" $cwd:t " complete" >> RUN.smoke.output # if Reportrun is true, generate reports of the appropriate level. if ($Reportrun == true) then echo "This is a Report RUN" >> RUN.smoke.output switch($reportInfo) case -Dir: run_dir $cwd -nodiff breaksw case -test: foreach file ($cwd/*.prt) run_test $file -nodiff end breaksw case -panel: foreach file ($cwd/*.prt) run_panel $file -nodiff end breaksw endsw endif # Reset XFILESEARCHPATH if (pathExists == true) then setenv XFILESEARCHPATH $Storepath else unsetenv XFILESEARCHPATH endif exit 0