ia64/xen-unstable

changeset 12376:bff7dde40467

When running tests unattended it's useful to know how long they have
taken, as (significantly) increasing the runtime (without introducing
failures) can be considered a regression. This patch adds a block like:

====
Xm-test timing summary:
Run Started : Fri, 10 Nov 2006 14:53:18 +1100
Run Stopped : Fri, 10 Nov 2006 14:53:20 +1100
====

to the generated report.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Nov 10 14:26:14 2006 +0000 (2006-11-10)
parents 32f7b40ace42
children 25e6a17e82f0
files tools/xm-test/runtest.sh
line diff
     1.1 --- a/tools/xm-test/runtest.sh	Fri Nov 10 14:22:30 2006 +0000
     1.2 +++ b/tools/xm-test/runtest.sh	Fri Nov 10 14:26:14 2006 +0000
     1.3 @@ -141,7 +141,11 @@ get_contact_info() {
     1.4  run_tests() {
     1.5      groupentered=$1
     1.6      output=$2
     1.7 +    report=$3
     1.8 +    startfile=${report}.start
     1.9 +    stopfile=${report}.stop
    1.10  
    1.11 +    date -R > $startfile
    1.12      exec <  grouptest/$groupentered
    1.13      while read casename testlist; do
    1.14         echo Running $casename tests...
    1.15 @@ -155,6 +159,7 @@ run_tests() {
    1.16         fi
    1.17  
    1.18      done
    1.19 +    date -R > $stopfile
    1.20  
    1.21  }
    1.22  
    1.23 @@ -164,7 +169,10 @@ make_text_reports() {
    1.24      failures=$2
    1.25      output=$3
    1.26      reportfile=$4
    1.27 +    report=$5
    1.28      summary=summary.tmp
    1.29 +    startfile=${report}.start
    1.30 +    stopfile=${report}.stop
    1.31      echo "Making PASS/FAIL report ($passfail)..."
    1.32      cat $OUTPUT | egrep '(REASON|PASS|FAIL|XPASS|XFAIL|SKIP)' | perl -pe 's/^(PASS|FAIL|XPASS|XFAIL)(.+)$/$1$2\n/' > $passfail
    1.33      
    1.34 @@ -175,7 +183,12 @@ make_text_reports() {
    1.35      NUMFAIL=`grep -c FAIL $output`
    1.36      NUMXPASS=`grep -c XPASS $output`
    1.37      NUMXFAIL=`grep -c XFAIL $output`
    1.38 +    START=`cat $startfile`
    1.39 +    STOP=`cat $stopfile`
    1.40      cat > $summary << EOF
    1.41 +Xm-test timing summary:
    1.42 +  Run Started : $START
    1.43 +  Run Stoped  : $STOP
    1.44  Xm-test execution summary:
    1.45    PASS:  $NUMPASS
    1.46    FAIL:  $NUMFAIL
    1.47 @@ -302,8 +315,8 @@ if [ "$run" != "no" ]; then
    1.48      if [ "$unsafe" = "no" ]; then
    1.49        make_environment_report $OSREPORTTEMP $PROGREPORTTEMP
    1.50      fi
    1.51 -    run_tests $GROUPENTERED $OUTPUT
    1.52 -    make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT
    1.53 +    run_tests $GROUPENTERED $OUTPUT $REPORT
    1.54 +    make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT $REPORT
    1.55      if [ "$unsafe" = "no" ]; then
    1.56        make_result_report $OUTPUT $RESULTREPORTTEMP
    1.57        cat $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP > $XMLREPORT