summaryrefslogtreecommitdiffstats
path: root/tests/window.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-11-18 01:47:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-11-18 01:47:51 (GMT)
commit7af2e46f13299ff7016bcb17e5bf20725aa25935 (patch)
tree87283d3114d5077cccedd07ffb74ffd8ef04e703 /tests/window.test
parentbb19ed403185f85f0d9993e40d4ea892890e5cf6 (diff)
downloadtk-7af2e46f13299ff7016bcb17e5bf20725aa25935.zip
tk-7af2e46f13299ff7016bcb17e5bf20725aa25935.tar.gz
tk-7af2e46f13299ff7016bcb17e5bf20725aa25935.tar.bz2
* tests/constraints.tcl:When running the test suite in a process
* tests/image.test: where Tk has been [load]ed, there's no * tests/select.test: guarantee that child processes created by * tests/unixWm.test: [exec [interpreter]] will have Tk in them. * tests/window.test: Made modifications to force a [load] of Tk in those situations.
Diffstat (limited to 'tests/window.test')
-rw-r--r--tests/window.test51
1 files changed, 34 insertions, 17 deletions
diff --git a/tests/window.test b/tests/window.test
index 9d62208..db80f97 100644
--- a/tests/window.test
+++ b/tests/window.test
@@ -5,12 +5,13 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: window.test,v 1.8 2003/04/01 21:07:02 dgp Exp $
+# RCS: @(#) $Id: window.test,v 1.9 2003/11/18 01:47:51 dgp Exp $
package require tcltest 2.1
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force ::tk::test::loadTkCommand
update
# XXX This file is woefully incomplete. Right now it only tests
@@ -76,11 +77,13 @@ test window-2.3 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} \
unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
update
bind . <Destroy> exit
destroy .
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -92,12 +95,14 @@ test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} \
test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} \
unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
toplevel .t
update
bind .t <Destroy> exit
destroy .t
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -109,12 +114,14 @@ test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} \
test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} \
unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
toplevel .t
update
bind .t <Destroy> exit
destroy .
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -126,13 +133,15 @@ test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} \
test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} \
unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
toplevel .t
toplevel .t.f
update
bind .t.f <Destroy> exit
destroy .
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -144,7 +153,8 @@ test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} \
test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} \
unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
toplevel .t1
toplevel .t2
toplevel .t3
@@ -153,7 +163,8 @@ test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} \
bind .t2 <Destroy> {destroy .t1}
bind .t1 <Destroy> {exit 0}
destroy .t3
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -165,14 +176,16 @@ test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} \
test window-2.9 {Tk_DestroyWindow, Destroy bindings
evaluated after exit} unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
toplevel .t1
toplevel .t2
update
bind .t2 <Destroy> {puts "Destroy .t2" ; exit 1}
bind .t1 <Destroy> {puts "Destroy .t1" ; exit 0}
destroy .t2
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -185,7 +198,8 @@ Destroy .t1}}
test window-2.10 {Tk_DestroyWindow, Destroy binding
evaluated once} unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
update
bind . <Destroy> {
puts "Destroy ."
@@ -193,7 +207,8 @@ test window-2.10 {Tk_DestroyWindow, Destroy binding
exit 0
}
destroy .
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
@@ -205,7 +220,8 @@ test window-2.10 {Tk_DestroyWindow, Destroy binding
test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} \
unixOrWin {
- set script [makeFile {
+ set code [loadTkCommand]
+ append code {
toplevel .t1
toplevel .t2
update
@@ -218,7 +234,8 @@ test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} \
}
bind .t2 <Destroy> {exit}
destroy .t2
- } script]
+ }
+ set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {