2 # -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*-
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is mozilla.org code.
18 # The Initial Developer of the Original Code is
19 # Mozilla Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 2006.
21 # the Initial Developer. All Rights Reserved.
24 # Bob Clary <bob@bclary.com>
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
40 source $TEST_DIR/bin
/library.sh
52 $SCRIPT -t testscript [-v ] datalist1 [datalist2 [datalist3 [datalist4]]]
55 =============== ===========================================================
56 -t testscript required. quoted test script with required arguments.
57 -v optional. verbose - copies log file output to stdout.
59 executes the testscript using the input data files in
60 $TEST_DIR/data constructed from each combination of the input parameters:
62 {item1},{item2},{item3},{item4}
68 unset testscript testargs
70 # remove script name from args
73 while getopts $options optname
;
77 let shiftargs
=$shiftargs+1
79 if echo $testscript |
grep -iq ' ' ; then
80 testargs
=`echo $testscript | sed 's|^\([^ ]*\)[ ]*\(.*\)|\2|'`
81 testscript
=`echo $testscript | sed 's|^\([^ ]*\)[ ]*.*|\1|'`
85 let shiftargs
=$shiftargs+1
90 if [[ -z "$testscript" ]]; then
96 datalist
=`combo.sh "$@"`
98 TEST_SUITE
=`dirname $testscript | sed "s|$TEST_DIR/||" | sed "s|/|_|g"`
100 for data
in $datalist; do
101 TEST_DATE
=`date -u +%Y-%m-%d-%H-%M-%S``date +%z`
102 TEST_LOG
="${TEST_DIR}/results/${TEST_DATE},$data,$OSID,${TEST_MACHINE},$TEST_SUITE.log"
104 if [[ "$OSID" == "nt" ]]; then
105 # If on Windows, set up the Windbg/CDB debug log file
106 # name to point to our log.
107 export _NT_DEBUG_LOG_FILE
="`cygpath -w $TEST_LOG`"
110 # tell caller what the log files are
111 echo "log: $TEST_LOG "
113 if [[ "$verbose" == "1" ]]; then
114 test-setup.sh
-d $TEST_DIR/data
/$data.data
2>&1 |
tee -a $TEST_LOG
115 $testscript $testargs -d $TEST_DIR/data
/$data.data
2>&1 |
tee -a $TEST_LOG
117 test-setup.sh
-d $TEST_DIR/data
/$data.data
>> $TEST_LOG 2>&1
118 $testscript $testargs -d $TEST_DIR/data
/$data.data
>> $TEST_LOG 2>&1
121 if [[ "$XPCOM_DEBUG_BREAK" == "stack" ]]; then
126 if findprogram fix-linux-stack.pl
; then
127 fix-linux-stack.pl
< $TEST_LOG > $TEST_LOG.tmp
128 mv $TEST_LOG.tmp
$TEST_LOG
130 error
"XPCOM_DEBUG_BREAK=stack specified but fix-linux-stack.pl is not available"
134 if findprogram fix-macosx-stack.pl
; then
135 fix-macosx-stack.pl
< $TEST_LOG > $TEST_LOG.tmp
136 mv $TEST_LOG.tmp
$TEST_LOG
138 error
"XPCOM_DEBUG_BREAK=stack specified but fix-macosx-stack.pl is not available"