[Swift-commit] r4729 - trunk/tests
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Sat Jul 2 13:51:20 CDT 2011
Author: hategan
Date: 2011-07-02 13:51:19 -0500 (Sat, 02 Jul 2011)
New Revision: 4729
Modified:
trunk/tests/suite.sh
Log:
mixed tc.data, some color, better default topdir
Modified: trunk/tests/suite.sh
===================================================================
--- trunk/tests/suite.sh 2011-07-02 18:25:54 UTC (rev 4728)
+++ trunk/tests/suite.sh 2011-07-02 18:51:19 UTC (rev 4729)
@@ -33,8 +33,9 @@
VERBOSE=0
TOTAL_TIME=0
INDIVIDUAL_TEST_TIME=0
+COLORIZE=0
# The directory in which to start:
-TOPDIR=$PWD
+TOPDIR=`readlink -f $PWD/../../../..`
while [ $# -gt 0 ]; do
case $1 in
@@ -78,6 +79,9 @@
-v)
VERBOSE=1
shift;;
+ -l)
+ COLORIZE=1
+ shift;;
*)
GROUPARG=$1
shift;;
@@ -89,6 +93,19 @@
HTML_COMMENTS=1
fi
+if [ $COLORIZE ]; then
+ LGREEN="\033[1;32m"
+ YELLOW="\033[1;33m"
+ RED="\033[1;31m"
+ GRAY="\033[0;37m"
+else
+ LGREEN=""
+ YELLOW=""
+ RED=""
+ GRAY=""
+fi
+
+
# Iterations per test (may want to run each test multiple times?)
ITERS_LOCAL=1
@@ -347,7 +364,7 @@
if [ "$RESULT" == "Passed" ]; then
printf %-10.10s "success">>$REPORT
else
- echo "FAILED"
+ echo -e "${RED}FAILED${GRAY}"
cat $RUNDIR/$TEST_LOG < /dev/null
printf %-10.10s "failure">>$REPORT
fi
@@ -364,7 +381,7 @@
html_td class "success" width 25 title "$CMD"
html_a_href $TEST_LOG "$LABEL"
else
- echo "FAILED"
+ echo -e "${RED}FAILED${GRAY}"
cat $RUNDIR/$TEST_LOG < /dev/null
html_td class "failure" width 25 title "$CMD"
html_a_href $TEST_LOG $LABEL
@@ -381,8 +398,12 @@
start_group() {
G=$1
echo
- echo $G
- echo
+ echo -e "${LGREEN}/----------------------------------------------------"
+ echo "|"
+ echo "| $G"
+ echo "|"
+ echo -e "\\----------------------------------------------------${GRAY}"
+ echo
if [ $TEXTREPORT == 1 ]; then
stars
printf "$G\n">>$REPORT
@@ -658,7 +679,7 @@
INDIVIDUAL_TEST_TIME=$(( STOP-START ))
TOTAL_TIME=$(( INDIVIDUAL_TEST_TIME+TOTAL_TIME ))
- echo "TOOK (seconds): $INDIVIDUAL_TEST_TIME"
+ echo -e "${YELLOW}TOOK (seconds): $INDIVIDUAL_TEST_TIME${GRAY}"
RESULT=$( result )
#Verifies the value of $RESULT, if the test was successful
@@ -889,6 +910,11 @@
cp -v $SWIFT_HOME/etc/tc.data .
[ $? != 0 ] && crash "Could not copy tc.data!"
fi
+ if [ -f $GROUP/tc.template.mix.data ]; then
+ sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.mix.data >> tc.data
+ [ $? != 0 ] && crash "Could not create tc.data!"
+ echo "Mixing: $GROUP/tc.template.mix.data"
+ fi
}
# Generate the CDM file, fs.data
@@ -962,9 +988,14 @@
TESTNAME=$( basename $TEST )
- echo -e "\nTest case: $TESTNAME"
+ echo
+ echo
+ echo "/--------------------------------------------------------------"
+ echo -e "| Test case: $LGREEN$TESTNAME$GRAY"
+ echo "\--------------------------------------------------------------"
+ echo
- cp -v $GROUP/$TESTNAME .
+ cp $GROUP/$TESTNAME .
TESTLINK=$TESTNAME
start_row
for (( i=0; $i<$ITERS_LOCAL; i=$i+1 )); do
More information about the Swift-commit
mailing list