From: Andreas K. <and...@ac...> - 2009-11-09 21:22:11
|
Andreas Drollinger wrote: > Andreas, > I have some troubles with the semi-bolilerplate code you are using as > test harness for the tcllib packages: > > # -------------------------------------------------------------------- > source [file join \ > [file dirname [file dirname [file join [pwd] [info script]]]] \ > devtools testutilities.tcl] > testsNeedTcl 8.2 > testsNeedTcltest 1.0 > testing { > useLocal aes.tcl aes > } > # -------------------------------------------------------------------- > > Calling my tests with source <TestFile> fails, How exactly are you invoking your tests ? The standard way of testing a module is (*), % ./sak.tcl test run ... modules/<yourmodule> where ... stands for additional options you may specify (**). This invokes the tests of <yourmodule> indirectly through the main driver script/application support/devel/all.tcl This driver loads tcltest, and also generates all the standard output sak.tcl is parsing for its display. I hope that helps. ~~~~~~~ (*) As documented in the file README.developer. (**) More information regarding the acceptable options can be had via % sak.tcl help test > since one of the first > executed commands of the testutilities.tcl file is 'if {![package > vsatisfies [package provide tcltest] 2.0]} {...'. > > But because the tcltest package is only loaded later with the > 'testsNeed'Tcltest' command, 'package provide tcltest' return an empty > string and this creates an error with the 'package vsatisfies' command. > > When I add 'package require tcltest' in front of the semi-bolilerplate > code my tests can be executed. But I guess this additional statement > should not be required using the correct test launch approach. > > So, could you tell me how exactly you are launching the test suite for > that the Tcltest package is already loaded before the test file is sourced? > > Thanks! > Andreas > -- Sincerely, Andreas Kupries <an...@ac...> Developer @ <http://www.activestate.com/> |