Sisyphus - add -v verbose output switch, bug 399879, r=rcampbell, not part of the build

This commit is contained in:
bclary@bclary.com 2007-10-23 09:52:36 -07:00
Родитель c9af7276cd
Коммит 47447f6bcf
5 изменённых файлов: 56 добавлений и 25 удалений

Просмотреть файл

@ -227,7 +227,7 @@ foreach $fix (@fixes) {
}
close OUTPUT;
print STDOUT "$outputprefix-results-possible-fixes.log\n";
print STDOUT "log: $outputprefix-results-possible-fixes.log\n";
debug "finding regressions";
@ -292,7 +292,7 @@ foreach $failure (@failures) {
}
close OUTPUT;
print STDOUT "$outputprefix-results-possible-regressions.log\n";
print STDOUT "log: $outputprefix-results-possible-regressions.log\n";
sub debug {

Просмотреть файл

@ -70,7 +70,7 @@ source ${TEST_BIN}/library.sh
usage()
{
cat <<EOF
usage: runtests.sh -p products -b branches -T buildtypes -B buildcommands [-e extra]
usage: runtests.sh -p products -b branches -T buildtypes -B buildcommands [-e extra] [-v]
usage: runtests.sh -p "$products" -b "$branches" -T "$buildtypes" -B "$buildcommands" -e "$extra"
variable description
@ -84,13 +84,16 @@ variable description
'clean checkout build'.
If you wish to skip any build steps, simply specify a value
not containing any of the build commands, e.g. 'none'.
-v optional. verbose - copies log file output to stdout.
if an argument contains more than one value, it must be quoted.
EOF
exit 2
}
while getopts "p:b:T:B:e:" optname;
verbose=0
while getopts "p:b:T:B:e:v" optname;
do
case $optname in
p) products=$OPTARG;;
@ -99,6 +102,8 @@ while getopts "p:b:T:B:e:" optname;
e) extra="$OPTARG"
extraflag="-e $OPTARG";;
B) buildcommands=$OPTARG;;
v) verbose=1
verboseflag="-v";;
esac
done
@ -116,7 +121,7 @@ case $buildtypes in
;;
opt|debug|opt*debug)
if [[ -n "$buildcommands" ]]; then
builder.sh -p "$products" -b "$branches" $extraflag -B "$buildcommands" -T "$buildtypes"
builder.sh -p "$products" -b "$branches" $extraflag -B "$buildcommands" -T "$buildtypes" "$verboseflag"
fi
;;
esac
@ -127,12 +132,12 @@ export testlogfiles
export testlogfile
if [[ -z "$extra" ]]; then
if tester.sh -t $TEST_JSDIR/test.sh "$products" "$branches" "$buildtypes" | tee -a $testlogfilelist; then
testlogfiles="`cat $testlogfilelist`"
if tester.sh -t $TEST_JSDIR/test.sh $verboseflag "$products" "$branches" "$buildtypes"| tee -a $testlogfilelist; then
testlogfiles="`grep '^log:' $testlogfilelist|sed 's|^log: ||'`"
fi
else
if tester.sh -t $TEST_JSDIR/test.sh "$products" "$branches" "$extra" "$buildtypes" | tee -a $testlogfilelist; then
testlogfiles="`cat $testlogfilelist`"
if tester.sh -t $TEST_JSDIR/test.sh $verboseflag "$products" "$branches" "$extra" "$buildtypes"| tee -a $testlogfilelist; then
testlogfiles="`grep '^log:' $testlogfilelist|sed 's|^log: ||'`"
fi
fi

Просмотреть файл

@ -70,7 +70,7 @@ source ${TEST_BIN}/library.sh
#
# options processing
#
options=":d:"
options="d:"
usage()
{
cat <<EOF

Просмотреть файл

@ -48,12 +48,12 @@ trap 'echo -e "\n*** ERROR ***\n\b" && tail $TEST_LOG' ERR
#
# options processing
#
options="p:b:B:T:e:d:"
options="p:b:B:T:e:d:v"
function usage()
{
cat<<EOF
usage:
$SCRIPT -p products -b branches -B buildcommands -T buildtypes [-e extra]
$SCRIPT -p products -b branches -B buildcommands -T buildtypes [-e extra] [-v]
variable description
=============== ===========================================================
@ -64,6 +64,7 @@ variable description
-e extra optional. extra qualifier to pick build tree and mozconfig.
-d datafiles optional. one or more filenames of files containing
environment variable definitions to be included.
-v optional. verbose - copies log file output to stdout.
note that the environment variables should have the same names as in the
"variable" column.
@ -84,6 +85,7 @@ while getopts $options optname ;
e) extra="-$OPTARG"
extraflag="-e $OPTARG";;
d) datafiles=$OPTARG;;
v) verbose=1;;
esac
done
@ -109,10 +111,13 @@ if echo "$buildcommands" | grep -iq clean; then
TEST_DATE=`date -u +%Y-%m-%d-%H-%M-%S``date +%z`
TEST_LOG="${TEST_DIR}/results/${TEST_DATE},$product,$branch$extra,$buildtype,$OSID,${TEST_MACHINE},clean.log"
echo "$TEST_LOG"
clean.sh -p $product -b $branch -T $buildtype $extraflag > $TEST_LOG 2>&1
echo "log: $TEST_LOG"
if [[ "$verbose" == "1" ]]; then
clean.sh -p $product -b $branch -T $buildtype $extraflag 2>&1 | tee $TEST_LOG
else
clean.sh -p $product -b $branch -T $buildtype $extraflag > $TEST_LOG 2>&1
fi
done
done
done
@ -126,10 +131,13 @@ if echo "$buildcommands" | grep -iq checkout; then
TEST_DATE=`date -u +%Y-%m-%d-%H-%M-%S``date +%z`
TEST_LOG="${TEST_DIR}/results/${TEST_DATE},$product,$branch$extra,$buildtype,$OSID,${TEST_MACHINE},checkout.log"
echo "$TEST_LOG"
echo "log: $TEST_LOG"
checkout.sh -p $product -b $branch -T opt $extraflag > $TEST_LOG 2>&1
if [[ "$verbose" == "1" ]]; then
checkout.sh -p $product -b $branch -T opt $extraflag 2>&1 | tee $TEST_LOG
else
checkout.sh -p $product -b $branch -T opt $extraflag > $TEST_LOG 2>&1
fi
done
done
@ -143,9 +151,14 @@ if echo "$buildcommands" | grep -iq build; then
TEST_DATE=`date -u +%Y-%m-%d-%H-%M-%S``date +%z`
TEST_LOG="${TEST_DIR}/results/${TEST_DATE},$product,$branch$extra,$buildtype,$OSID,${TEST_MACHINE},build.log"
echo "$TEST_LOG"
echo "log: $TEST_LOG"
if [[ "$verbose" == "1" ]]; then
build.sh -p $product -b $branch -T $buildtype $extraflag 2>&1 | tee $TEST_LOG
else
build.sh -p $product -b $branch -T $buildtype $extraflag > $TEST_LOG 2>&1
fi
build.sh -p $product -b $branch -T $buildtype $extraflag > $TEST_LOG 2>&1
done
done
done

Просмотреть файл

@ -48,7 +48,7 @@ TEST_LOG=/dev/null
#
# options processing
#
options="p:b:e:T:t:"
options="p:b:e:T:t:v"
function usage()
{
cat<<EOF
@ -58,6 +58,7 @@ $SCRIPT -t testscript datalist1 [datalist2 [datalist3 [datalist4]]]
variable description
=============== ===========================================================
-t testscript required. quoted test script with required arguments.
-v optional. verbose - copies log file output to stdout.
executes the testscript using the input data files in
$TEST_DIR/data constructed from each combination of the input parameters:
@ -70,16 +71,23 @@ EOF
unset testscript testargs
# remove script name from args
shiftargs=1
while getopts $options optname ;
do
case $optname in
t)
let shiftargs=$shiftargs+1
testscript="$OPTARG"
if echo $testscript | grep -iq ' ' ; then
testargs=`echo $testscript | sed 's|^\([^ ]*\)[ ]*\(.*\)|\2|'`
testscript=`echo $testscript | sed 's|^\([^ ]*\)[ ]*.*|\1|'`
fi
;;
v) verbose=1
let shiftargs=$shiftargs+1
;;
esac
done
@ -87,7 +95,7 @@ if [[ -z "$testscript" ]]; then
usage
fi
shift 2
shift $shiftargs
datalist=`combo.sh "$@"`
@ -98,9 +106,14 @@ for data in $datalist; do
TEST_LOG="${TEST_DIR}/results/${TEST_DATE},$data,$OSID,${TEST_MACHINE},$TEST_SUITE.log"
# tell caller what the log files are
echo "$TEST_LOG "
echo "log: $TEST_LOG "
test-setup.sh -d $TEST_DIR/data/$data.data >> $TEST_LOG 2>&1
if [[ "$verbose" == "1" ]]; then
test-setup.sh -d $TEST_DIR/data/$data.data 2>&1 | tee -a $TEST_LOG
$testscript $testargs -d $TEST_DIR/data/$data.data 2>&1 | tee -a $TEST_LOG
else
test-setup.sh -d $TEST_DIR/data/$data.data >> $TEST_LOG 2>&1
$testscript $testargs -d $TEST_DIR/data/$data.data >> $TEST_LOG 2>&1
fi
$testscript $testargs -d $TEST_DIR/data/$data.data >> $TEST_LOG 2>&1
done