Posted to tcl by jnc at Tue Oct 18 13:25:09 GMT 2011view raw

  1. # FILE: example.test
  2. package require tcltest
  3.  
  4. eval ::tcltest::configure $argv
  5.  
  6. namespace eval ::simpletest {
  7. namespace import ::tcltest::*
  8.  
  9. test Test1 {Test 1} {
  10. return 1
  11. } 1
  12.  
  13. test Test2 {Test 2} {
  14. return 2
  15. } 2
  16.  
  17. test Test3 {Test 3} {
  18. return 3
  19. } 3
  20. }
  21.  
  22. namespace delete ::simpletest
  23.  
  24. # FILE: test.tcl
  25. package require tcltest
  26.  
  27. ::tcltest::configure -testdir \
  28. [file dirname [file normalize [info script]]]
  29. eval ::tcltest::configure $argv
  30. ::tcltest::runAllTests
  31.  
  32. # CONSOLE OUTPUT
  33. C:\Development\Projects\tcl_test>tclsh86 test.tcl -verbose p
  34. Tests running in interp: C:/Development/Tools/Tcl/bin/tclsh86.exe
  35. Tests located in: C:/Development/Projects/tcl_test
  36. Tests running in: C:/Development/Projects/tcl_test
  37. Temporary files stored in C:/Development/Projects/tcl_test
  38. Test files run in separate interpreters
  39. Running tests that match: *
  40. Skipping test files that match: l.*.test
  41. Only running test files that match: *.test
  42. Tests began at Tue Oct 18 09:24:59 EDT 2011
  43. example.test
  44. ++++ Test1 PASSED
  45. ++++ Test2 PASSED
  46. ++++ Test3 PASSED
  47.  
  48. Tests ended at Tue Oct 18 09:24:59 EDT 2011
  49. test.tcl: Total 0 Passed 0 Skipped 0 Failed 0
  50. Sourced 1 Test Files.

Comments

Posted by jnc at Tue Oct 18 13:33:47 GMT 2011 [text] [code]

The problem was I did not call cleanupTests at the bottom of my test file. Adding cleanupTests as the man page states fixes the "problem"