Create a log file as well as stdout during test
authorUlf Samuelsson <ulf.samuelsson@atmel.com>
Mon, 2 Feb 2009 07:18:19 +0000 (07:18 -0000)
committerUlf Samuelsson <ulf.samuelsson@atmel.com>
Mon, 2 Feb 2009 07:18:19 +0000 (07:18 -0000)
scripts/testheader.inc

index ea410a9addcaa2d66e1acc841f36db98f7b115a7..232e1e0a1e568741fe7300eb633eef4776229bdc 100644 (file)
@@ -1,13 +1,14 @@
 ARCH=`make -f scripts/test/Makefile ARCH`
-
+DATE=`date +%Y%m%d`
+LOGFILE=build-results-${DATE}-${ARCH}.log
 function mk()
 {
-       scripts/mkpkg $1 $2 "$3"
+       scripts/mkpkg $1 $2 "$3"                        | tee -a ${LOGFILE}
 }
 
 function       header()
 {
-       echo "#!/bin/sh"
+       echo "#!/bin/sh"                                | tee -a ${LOGFILE}
        echo "source \"scripts/testheader.inc\""
        
 }
@@ -17,51 +18,51 @@ busybox=0
 
 function       SKIP()
 {
-       echo SKIP
+       echo SKIP                                       | tee -a ${LOGFILE}
        active=0
 }
 
 function       RESTART()
 {
-       echo RESTART
+       echo RESTART                                    | tee -a ${LOGFILE}
        active=1
 }
 
 function       EXE()
 {
-       printf  "EXE    "
+       printf  "EXE    "                               | tee -a ${LOGFILE}
        if [ ${active} == 1 ] ; then
                $1 $2 $3 "$4"
                return 0;
        else
-               printf  "%-8s"  "$1"
-               printf  "%-32s" "$2"
-               printf  "%-16s" "$3"
+               printf  "%-8s"  "$1"                    | tee -a ${LOGFILE}
+               printf  "%-32s" "$2"                    | tee -a ${LOGFILE}
+               printf  "%-16s" "$3"                    | tee -a ${LOGFILE}
                if [ "${4}X" != "X" ] ; then
-                       printf  "%-64s" "\"$4\""
+                       printf  "%-64s" "\"$4\""        | tee -a ${LOGFILE}
                fi
-               echo
+               echo                                    | tee -a ${LOGFILE}
                return 1;
        fi
 }
 
 function       AVR()
 {
-       printf  "AVR    "
+       printf  "AVR    "                               | tee -a ${LOGFILE}
        if [ "${ARCH}X" == "avr32X" ] ; then
-               echo "mk $2 UNSUPPORTED \"$4\" $5 $6"
+               echo "mk $2 UNSUPPORTED \"$4\" $5 $6"   | tee -a ${LOGFILE}
                return 1;
        elif [ ${active} == 1 ] ; then
                $1 $2 "$3" "$4"
                return 0;
        else
-               printf  "%-8s"  "$1"
-               printf  "%-32s" "$2"
-               printf  "%-16s" "$3"
+               printf  "%-8s"  "$1"                    | tee -a ${LOGFILE}
+               printf  "%-32s" "$2"                    | tee -a ${LOGFILE}
+               printf  "%-16s" "$3"                    | tee -a ${LOGFILE}
                if [ "${4}X" != "X" ] ; then
-                       printf  "%-64s" "\"$4\"";
+                       printf  "%-64s" "\"$4\""        | tee -a ${LOGFILE}
                fi
-               echo
+               echo                                    | tee -a ${LOGFILE}
                return 1;
        fi
 }
@@ -69,53 +70,53 @@ function    AVR()
 
 function skip()
 {
-       printf "skip    %-8s" "$1"
-       printf "%-32s" "$2"
+       printf "skip    %-8s" "$1"                      | tee -a ${LOGFILE}
+       printf "%-32s" "$2"                             | tee -a ${LOGFILE}
        if [   "$3X" == "OKX" ] ; then
-               printf "%-16s"  "DISABLED"
+               printf "%-16s"  "DISABLED"              | tee -a ${LOGFILE}
                if [ "${4}X" != "X" ] ; then
-                       printf  "%-64s" "\"$4\""
+                       printf  "%-64s" "\"$4\""        | tee -a ${LOGFILE}
                fi
        elif [ "$3X" == "FAILX" ] ; then
-               printf "%-16s"  "DISABLED"
+               printf "%-16s"  "DISABLED"              | tee -a ${LOGFILE}
                if [ "${4}X" != "X" ] ; then
-                       printf  "%-64s" "\"$4\""
+                       printf  "%-64s" "\"$4\""        | tee -a ${LOGFILE}
                fi
        elif [ "$3X" == "BROKENX" ] ; then
-               printf "%-16s"  "DISABLED"
+               printf "%-16s"  "DISABLED"              | tee -a ${LOGFILE}
                if [ "${4}X" != "X" ] ; then
-                       printf  "%-64s" "\"$4\""
+                       printf  "%-64s" "\"$4\""        | tee -a ${LOGFILE}
                fi
        elif [ "$3X" == "DISABLEDX" ] ; then
-               printf "%-16s"  "DISABLED"
+               printf "%-16s"  "DISABLED"              | tee -a ${LOGFILE}
                if [ "${4}X" != "X" ] ; then
-                       printf  "%-64s" "\"$4\""
+                       printf  "%-64s" "\"$4\""        | tee -a ${LOGFILE}
                fi
        else
-               printf "%-16s"  "DISABLED"
+               printf "%-16s"  "DISABLED"              | tee -a ${LOGFILE}
                if [ "${4}X" != "X" ] ; then
-                       printf  "%-64s" "\"$4\""
+                       printf  "%-64s" "\"$4\""        | tee -a ${LOGFILE}
                fi
        fi
-       echo
+       echo                                            | tee -a ${LOGFILE}
 }
 
 function bb()
 {
-       printf  "%-8s"  "bb"
+       printf  "%-8s"  "bb"                            | tee -a ${LOGFILE}
        if [ ${busybox} == 1 ] ; then
-               printf "%-8s"   "$1"
+               printf "%-8s"   "$1"                    | tee -a ${LOGFILE}
                $1 $2 $3 $4 $5 $6
                return 0;
        else
-               echo "$1        $2 $3 $4 $5 $6"
+               echo "$1        $2 $3 $4 $5 $6"         | tee -a ${LOGFILE}
                return 1;
        fi
 }
 
 function       comment()
 {
-       echo    "comment        $1"
+       echo    "comment        $1"                     | tee -a ${LOGFILE}
 }
 
 # Enable HASERL