Index: library/lib/nx-test.tcl =================================================================== diff -u -re884c2b0d63fa1b5a691e866ccff8d4094a2a8e4 -red172f2c771eab171130a72af81921b910736989 --- library/lib/nx-test.tcl (.../nx-test.tcl) (revision e884c2b0d63fa1b5a691e866ccff8d4094a2a8e4) +++ library/lib/nx-test.tcl (.../nx-test.tcl) (revision ed172f2c771eab171130a72af81921b910736989) @@ -35,19 +35,24 @@ :class variable failure 0 :class variable testfile "" :class variable count 0 + :class variable time 0 :public class method success {} { incr :success } :public class method failure {} { incr :failure } + :public class method time {ms:double} { + set :time [expr {${:time} + $ms}] + } :public class method destroy {} { lappend msg \ file [file rootname [file tail ${:testfile}]] \ tests [expr {${:success} + ${:failure}}] \ success ${:success} \ - failure ${:failure} + failure ${:failure} \ + time ${:time} puts "Summary: $msg" array set "" $::argv if {[info exists (-testlog)]} { @@ -108,7 +113,8 @@ foreach example [lsort [:info instances -closure]] { $example run } - puts stderr "Total Time: [expr {[clock clicks -milliseconds]-$startTime}] ms" + set ms [expr {[clock clicks -milliseconds]-$startTime}] + puts stderr "Total Time: $ms ms" } :public method call {msg cmd} { @@ -117,6 +123,7 @@ } :public method run args { + set startTime [clock clicks -milliseconds] :exitOn if {[info exists :pre]} {:call "pre" ${:pre}} if {![info exists :msg]} {set :msg ${:cmd}} @@ -161,6 +168,7 @@ :exit -1 } if {[info exists :post]} {:call "post" ${:post}} + ::nx::Test time [expr {[clock clicks -milliseconds]-$startTime}] :exitOff } Index: tests/summary.tcl =================================================================== diff -u -r67c92d72f53bd368ff0fce6555ec803e859d7300 -red172f2c771eab171130a72af81921b910736989 --- tests/summary.tcl (.../summary.tcl) (revision 67c92d72f53bd368ff0fce6555ec803e859d7300) +++ tests/summary.tcl (.../summary.tcl) (revision ed172f2c771eab171130a72af81921b910736989) @@ -1,21 +1,29 @@ +# -*- Tcl -*- +# +# This script computes the regression test summary displayed at the +# end of the regression test. It aggreates the content of the test log +# provided via arg "-testlog". array set opt $::argv + if {[info exists opt(-testlog)]} { set f [open $opt(-testlog)]; set content [read $f]; close $f - lassign {0 0 0 0} tests success failures files + lassign {0 0 0 0 0.0} tests success failures files time foreach l [split $content \n] { array set "" $l if {[info exists (tests)]} { incr tests $(tests) incr failures $(failure) incr success $(success) incr files 1 + set time [expr {$time + $(time)}] } } + puts "\nRegression Test Summary:" puts "\tEnvironment: Tcl $tcl_patchLevel, OS $tcl_platform(os) $tcl_platform(osVersion)\ machine $tcl_platform(machine) threaded $tcl_platform(threaded)." - puts "\tNSF performed $tests tests in $files files, success $success, failures $failures." + puts "\tNSF performed $tests tests in $files files, success $success, failures $failures in time [expr {$time / 1000.0}] seconds" if {$failures == 0} { puts "\tCongratulations, NSF [package require nsf], NX [package require nx], and\ XOTcl [package require XOTcl 2] work fine in your environment."