diff options
author | dkf <dkf@noemail.net> | 2011-07-26 20:00:23 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-07-26 20:00:23 (GMT) |
commit | 5e6322033a7f127c4e9ea6c0244dd173c0c0104d (patch) | |
tree | f05473accd27a61671c8ffd507076c466183540e | |
parent | c236d1c42bb1d5fd3f6b5037f0fa9ef9203eb3e4 (diff) | |
download | tcl-5e6322033a7f127c4e9ea6c0244dd173c0c0104d.zip tcl-5e6322033a7f127c4e9ea6c0244dd173c0c0104d.tar.gz tcl-5e6322033a7f127c4e9ea6c0244dd173c0c0104d.tar.bz2 |
Ensure that TclOO is properly found by all the various package mechanisms (by
adding a dummy ifneeded script) and not just some of them.
FossilOrigin-Name: b90f2472991881bb2480ff78f5146fd031f215ff
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | generic/tclOO.c | 1 | ||||
-rw-r--r-- | tests/oo.test | 19 |
3 files changed, 15 insertions, 15 deletions
@@ -1,10 +1,16 @@ +2011-07-26 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclOO.c (initScript): Ensure that TclOO is properly found by + all the various package mechanisms (by adding a dummy ifneeded script) + and not just some of them. + 2011-07-21 Jan Nijtmans <nijtmans@users.sf.net> - * win/tclWinPort.h: [Bug 3372130] Fix hypot math function with MSVC10 + * win/tclWinPort.h: [Bug 3372130]: Fix hypot math function with MSVC10 2011-07-19 Don Porter <dgp@users.sourceforge.net> - * generic/tclUtil.c: [Bug 3371644] Repair failure to properly handle + * generic/tclUtil.c: [Bug 3371644]: Repair failure to properly handle * tests/util.test: (length == -1) scanning in TclConvertElement(). Thanks to Thomas Sader and Alexandre Ferrieux. diff --git a/generic/tclOO.c b/generic/tclOO.c index 9df3f53..8b76eeb 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -130,6 +130,7 @@ static const DeclaredClassMethod objMethods[] = { }; static char initScript[] = + "package ifneeded TclOO " TCLOO_PATCHLEVEL " {# Already present, OK?};" "namespace eval ::oo { variable version " TCLOO_VERSION " };" "namespace eval ::oo { variable patchlevel " TCLOO_PATCHLEVEL " };"; /* "tcl_findLibrary tcloo $oo::version $oo::version" */ diff --git a/tests/oo.test b/tests/oo.test index e8f770c..b12cb42 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -2,7 +2,7 @@ # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # -# Copyright (c) 2006-2008 Donal K. Fellows +# Copyright (c) 2006-2011 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -29,15 +29,9 @@ if {[testConstraint memory]} { return [expr {$end - $tmp}] } } - -proc initInterpreter name { - $name eval [list package ifneeded TclOO [package provide TclOO] \ - [package ifneeded TclOO [package provide TclOO]]] -} test oo-0.1 {basic test of OO's ability to clean up its initial state} { interp create t - initInterpreter t t eval { package require TclOO } @@ -45,11 +39,11 @@ test oo-0.1 {basic test of OO's ability to clean up its initial state} { } {} test oo-0.2 {basic test of OO's ability to clean up its initial state} { set i [interp create] - initInterpreter $i interp eval $i { package require TclOO namespace delete :: } + interp delete $i } {} test oo-0.3 {basic test of OO's ability to clean up its initial state} -body { leaktest { @@ -72,7 +66,6 @@ test oo-0.5 {testing literal leak on interp delete} memory { } 0 test oo-0.6 {cleaning the core class pair; way #1} -setup { interp create t - initInterpreter t } -body { t eval { package require TclOO @@ -84,7 +77,6 @@ test oo-0.6 {cleaning the core class pair; way #1} -setup { } -result {0 {} 1 {invalid command name "object"}} test oo-0.7 {cleaning the core class pair; way #2} -setup { interp create t - initInterpreter t } -body { t eval { package require TclOO @@ -106,6 +98,10 @@ test oo-0.8 {leak in variable management} -setup { } -cleanup { foo destroy } -result 0 +test oo-0.9 {various types of presence of the TclOO package} { + list [lsearch -nocase -all -inline [package names] tcloo] \ + [package present TclOO] [package versions TclOO] +} [list TclOO $::oo::version $::oo::version] test oo-1.1 {basic test of OO functionality: no classes} { set result {} @@ -272,7 +268,6 @@ test oo-2.1 {basic test of OO functionality: constructor} -setup { # This is a bit complex because it needs to run in a sub-interp as # we're modifying the root object class's constructor interp create subinterp - initInterpreter subinterp subinterp eval { package require TclOO } @@ -340,7 +335,6 @@ test oo-3.1 {basic test of OO functionality: destructor} -setup { # This is a bit complex because it needs to run in a sub-interp as we're # modifying the root object class's constructor interp create subinterp - initInterpreter subinterp subinterp eval { package require TclOO } @@ -361,7 +355,6 @@ test oo-3.2 {basic test of OO functionality: destructor} -setup { # This is a bit complex because it needs to run in a sub-interp as # we're modifying the root object class's constructor interp create subinterp - initInterpreter subinterp subinterp eval { package require TclOO } |