Index: .gitignore =================================================================== diff -u -N -r054bfcdd29faf76a0be3cec28e09de9917cbd4f8 -r67c92d72f53bd368ff0fce6555ec803e859d7300 --- .gitignore (.../.gitignore) (revision 054bfcdd29faf76a0be3cec28e09de9917cbd4f8) +++ .gitignore (.../.gitignore) (revision 67c92d72f53bd368ff0fce6555ec803e859d7300) @@ -2,6 +2,7 @@ *.[oa] *.gcda *.gcno +*.gcov *.dylib *~ .DS_Store @@ -10,6 +11,8 @@ autom4te.cache config.* callgrind.out.* +test.log +doc/junk.junk *.dSYM *.plist *-xotcl.html Index: Makefile.in =================================================================== diff -u -N -r88e54fa5bb23eb546abf7f676afa03aa697ac813 -r67c92d72f53bd368ff0fce6555ec803e859d7300 --- Makefile.in (.../Makefile.in) (revision 88e54fa5bb23eb546abf7f676afa03aa697ac813) +++ Makefile.in (.../Makefile.in) (revision 67c92d72f53bd368ff0fce6555ec803e859d7300) @@ -474,11 +474,17 @@ gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) -test: binaries libraries test-core test-xotcl test-http @test_actiweb@ +test: binaries libraries test-core test-xotcl test-http @test_actiweb@ test-summary test-nohttp: binaries libraries test-core test-xotcl -#TESTFLAGS = -srcdir $(srcdir) +TESTLOG = ./test.log +TESTFLAGS = -testlog $(TESTLOG) + +test-summary: + $(TCLSH) $(src_test_dir_native)/summary.tcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) + test-core: $(TCLSH_PROG) + rm -f $(TESTLOG) $(TCLSH) $(src_test_dir_native)/object-system.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/destroy.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/methods.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) Index: TODO =================================================================== diff -u -N -r2cca652c92b1933dd1b27f002a4c4886730f34f1 -r67c92d72f53bd368ff0fce6555ec803e859d7300 --- TODO (.../TODO) (revision 2cca652c92b1933dd1b27f002a4c4886730f34f1) +++ TODO (.../TODO) (revision 67c92d72f53bd368ff0fce6555ec803e859d7300) @@ -4045,6 +4045,9 @@ Setting emtpy mixin-lists is strictly speaking not necessary, but this eases the code in cases the lists are sometimes empty. +nx::test: +- added summary at the end of "make test" via log file +- updated .gitignore ======================================================================== TODO: Index: library/lib/nx-test.tcl =================================================================== diff -u -N -r9333bfa110291a29fa898b0ce554e8848db5d031 -r67c92d72f53bd368ff0fce6555ec803e859d7300 --- library/lib/nx-test.tcl (.../nx-test.tcl) (revision 9333bfa110291a29fa898b0ce554e8848db5d031) +++ library/lib/nx-test.tcl (.../nx-test.tcl) (revision 67c92d72f53bd368ff0fce6555ec803e859d7300) @@ -31,8 +31,31 @@ :property pre :property post - set :count 0 + :class variable success 0 + :class variable failure 0 + :class variable testfile "" + :class variable count 0 + :public class method success {} { + incr :success + } + :public class method failure {} { + incr :failure + } + :public class method destroy {} { + lappend msg \ + file [file rootname [file tail ${:testfile}]] \ + tests [expr {${:success} + ${:failure}}] \ + success ${:success} \ + failure ${:failure} + puts "Summary: $msg" + array set "" $::argv + if {[info exists (-testlog)]} { + set f [open $(-testlog) a]; puts $f $msg; close $f + } + next + } + :public class method case {name arg:optional} { # # Experimental version of Test case, which (1) accepts test case as argument @@ -70,6 +93,7 @@ :public class method new args { set testfile [file rootname [file tail [info script]]] + set :testfile $testfile if {[info exists :case]} { if {![info exists :ccount(${:case})]} {set :ccount(${:case}) 0} set :name $testfile/${:case}.[format %.3d [incr :ccount(${:case})]] @@ -114,15 +138,20 @@ #puts stderr "running {time {::namespace eval ${:namespace} ${:cmd}} $c} => $r1" regexp {^(-?[0-9]+) +} $r1 _ mS1 set ms [expr {($mS1 - $mS0) * 1.0 / $c}] + # if for some reason the run of the test is faster than the + # body-less eval, don't report negative values. + if {$ms < 0} {set ms 0.0} puts stderr "[set :name]:\t[format %6.2f $ms]\tmms, ${:msg} (overhead [format %.2f [expr {$mS0*1.0/$c}]])" } else { puts stderr "[set :name]: ${:msg} ok" } + ::nx::Test success } else { puts stderr "[set :name]:\tincorrect result for '${:msg}', expected:" puts stderr "'${:expected}', got\n'$r'" puts stderr "\tin test file [info script]" if {[info exists :errorReport]} {eval [set :errorReport]} + ::nx::Test failure # # Make sure that the script exits with an error code, but # unwind the callstack via return with an error code. Using Index: tests/summary.tcl =================================================================== diff -u -N --- tests/summary.tcl (revision 0) +++ tests/summary.tcl (revision 67c92d72f53bd368ff0fce6555ec803e859d7300) @@ -0,0 +1,25 @@ + +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 + foreach l [split $content \n] { + array set "" $l + if {[info exists (tests)]} { + incr tests $(tests) + incr failures $(failure) + incr success $(success) + incr files 1 + } + } + 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." + if {$failures == 0} { + puts "\tCongratulations, NSF [package require nsf], NX [package require nx], and\ + XOTcl [package require XOTcl 2] work fine in your environment." + } + puts "" +} +