summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrischan <krischan>2002-12-30 21:43:48 (GMT)
committerkrischan <krischan>2002-12-30 21:43:48 (GMT)
commitabeddb25950d2c0f6a16017758ab546bf66d5663 (patch)
tree482faad78bf581daeeeb4cbd9a33abecfb15495e
parent71a164f01c882d7bfdc171be107e81e98806b780 (diff)
downloadtktreectrl-abeddb25950d2c0f6a16017758ab546bf66d5663.zip
tktreectrl-abeddb25950d2c0f6a16017758ab546bf66d5663.tar.gz
tktreectrl-abeddb25950d2c0f6a16017758ab546bf66d5663.tar.bz2
Defines a proc package_require, which can be used by the test files
until tkTreeCtrl will find the library even if it is not yet installed.
-rwxr-xr-xtests/all.tcl34
1 files changed, 33 insertions, 1 deletions
diff --git a/tests/all.tcl b/tests/all.tcl
index c005514..5eb0c60 100755
--- a/tests/all.tcl
+++ b/tests/all.tcl
@@ -7,7 +7,7 @@
# Copyright (c) 1998-2000 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: all.tcl,v 1.1 2002/12/24 22:13:55 krischan Exp $
+# RCS: @(#) $Id: all.tcl,v 1.2 2002/12/30 21:43:48 krischan Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -42,6 +42,38 @@ if {[llength $::tcltest::matchFiles] > 0} {
set timeCmd {clock format [clock seconds]}
puts $chan "Tests began at [eval $timeCmd]"
+# Currently the following doesn't work if tktreectrl is not yet installed:
+# package require treectrl
+# And we want to test the currently built version anyway.
+# So we have to load and source it by hand, until TreectrlInit()
+# evals the initScript with calls of tcl_findLibrary...
+
+proc package_require {treectrl} {
+ set thisPlatform $::tcl_platform(platform)
+ if {![catch {tk windowingsystem} windowingSystem] \
+ && [string equal aqua $windowingSystem]} {
+ set thisPlatform macosx
+ }
+ switch -- $thisPlatform {
+ macintosh {
+ load treectrl.shlb
+ }
+ macosx {
+ load build/treectrl.dylib
+ }
+ unix {
+ load [glob libtreectrl*[info sharedlibextension]]
+ }
+ default { # Windows
+ load Build/treectrl[info sharedlibextension]
+ }
+ }
+ if {![namespace exists ::TreeCtrl]} {
+ uplevel #0 source [file join library treectrl.tcl]
+ uplevel #0 source [file join library filelist-bindings.tcl]
+ }
+}
+
# source each of the specified tests
foreach file [lsort [::tcltest::getMatchingFiles]] {
set tail [file tail $file]