Tk Library Source Code

Artifact [3e1d8ee257]
Login

Artifact 3e1d8ee25729b3653e47b9be46e837fdfe550fc7:

Attachment "tcllib.diff" to ticket [410105ffff] added by andreas_kupries 2001-03-21 02:05:44.
--- ./ChangeLog.orig	Tue Mar 20 19:41:46 2001
+++ ./ChangeLog	Tue Mar 20 19:38:59 2001
@@ -1,3 +1,25 @@
+2001-03-20  Andreas Kupries <[email protected]>
+
+	* all.tcl: Squashed a subtle bug with package management for the
+	  tests. Changes: all.tcl now adds the module path to the
+	  auto_path (the tested modules did it themselves before) and also
+	  moved the setting of the auto_path in the slave before the first
+	  'package require'. Why ? Assume the old code, an installed
+	  fileutil 1.0 and a new fileutil 1.1 under development. The
+	  initialization of the tests scans the package directories and
+	  finds fileutil 1.0. The module then adds itself to the auto_path
+	  and then requires fileutil (without version). Now fileutil 1.0
+	  is found by the pkg management, it is acceptable according to
+	  the rules of require and thus used. The new version is not
+	  considered at all, as changing the auto_path does *not* enforce
+	  a rescan of package directories. It is possible to solve the
+	  problem by having the modules require themselves and request a
+	  specific version (1.1 in this case). But this would mean that in
+	  each module we have (at least) one more file containing the
+	  version number (all test files!) and we have to maintain this
+	  for every module. The change here however solves the problem
+	  without touching the modules at all.
+
 2000-11-02  Brent Welch <[email protected]>
 
         * configure.in: Bumped version number to 0.8
--- ./all.tcl.orig	Wed May 31 01:59:59 2000
+++ ./all.tcl	Tue Mar 20 19:28:25 2001
@@ -98,13 +98,18 @@
 puts stdout "Tests began at [eval $timeCmd]"
 
 set auto_path [linsert $auto_path 0 [file join $root modules]]
+set old_apath $auto_path
 
 foreach module $modules {
     set ::tcltest::testsDirectory [file join $root modules $module]
+
     if { ![file isdirectory $::tcltest::testsDirectory] } {
 	puts stdout "unknown module $module"
     }
 
+    set auto_path $old_apath
+    set auto_path [linsert $auto_path 0 $::tcltest::testsDirectory]
+
     # foreach module, make a slave interp and source that module's tests into
     # the slave.  This isolates the test suites from one another.
     puts stdout "Module:\t[file tail $module]"
@@ -113,10 +118,10 @@
     # import the auto_path from the parent interp, so "package require" works
     $c eval {
 	set ::tcllibModule [pSet module]
+	set auto_path [pSet auto_path]
 	package require tcltest
 	namespace import ::tcltest::*
 	set ::tcltest::testSingleFile false
-	set auto_path [pSet auto_path]
     }
     interp alias $c ::tcltest::cleanupTestsHook {} \
 	    ::tcltest::cleanupTestsHook $c