From: Andreas K. <and...@ac...> - 2008-06-17 22:55:09
|
> Well, what about a small helper package? One could make the above > > package require tcllib::testutilities > tcllib::testutilities::init > > or something like that. The separate [tcllib::testutilities::init] call > would be needed to retrieve the [info script] data, although now that I > think about it, one could (if really devious) embed such a call into > the [package ifneeded] script as well. An explicit call does however > have the advantage that one can, if necessary, customise the > initialisation (no, I don't have a clear use-case for that right now; > maybe too tired). > What is gained by [package require tcllib::testutilities] is primarily > that one avoids hardcoding paths (relative paths, yes, but still > hardcoded paths) into the test files. The price you are paying for this is that you now cannot run the testsuite anymore if Tcllib is not installed because the package won't be found. Or using the wrong helper package if some other version of Tcllib is installed. Running the testsuite of Tcllib without Tcllib installed is IMHO an important use case during development. To re-enable execution you have to extend the auto_path, adding again the path information you do not want to the .test files. Even so it stays brittle because anybody can intercept this by adding a higher version of the helper package anywhere on the auto_path. Extending the auto_path through the setup code done by 'sak test run' ... is possible, however then the .test files become dependent on this exact tool, and IIRC there are people who wish to run the tcllib testsuite through their own tools, and not sak, making such a dependency a bad thing. -- Andreas Kupries <and...@Ac...> Developer @ http://www.ActiveState.com Tel: +1 778-786-1122 |