From: KATO K. <k.k...@gm...> - 2008-06-22 11:43:31
|
*** 'installers': How to specify forcibly the module of testsuite used by the [whole test] before installation can be considered. It is the form where [tcltest-2.x.x.tm] is enclosed in the distribution package of tcllib. (Probably it is arranged below at [support/devel/*]) *** 'developers': Except for the minute version difference, we may assume that the common testsuite tool is installed. I want you to be the form which can do both the whole test of tcllib and the simple test of the module I am writing. Now, the test script is arranged to the same directory as each module, and there may be assumption of operating a test script alone by a modular current directory. That is, there is two usage. (1) ensemble test $ sak test run modules/foo (2) single test $ cd modules/foo $ tclsh foo.test In (2), it should be cautious of necessarily not using devtools of tcllib. But it will be thought that he wants to use convenient support-tool. However the tool is not necessarily installed at[.. /devtools/*] *** 'solution': Branch is required to support both (1) and (2). # --------------- # foo.test begin if {[lsearch [namespace children] ::tcllibtest] == -1} { # (1) ensemble test package require tcllib::testutilities testsNeedTcl 8.3 testsNeedTcltest 1.0 testing { useLocal foo.tcl foo } } else { # (2) single test set selfrun 1 package require tcltest namespace import ::tcltest::* source foo.tcl } test foo-1.1 "concrete tests..." { [body] } { result } test foo-1.2 ... .. . if [info exists selfrun] { tcltest::cleanupTests } else { testsuiteCleanup } # foo.test end # --------------- What is necessary is just to guarantee operating correctly by (1) as a test script enclosed to tcllib. |