summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-28 15:56:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-28 15:56:15 (GMT)
commitf229cc87ab8e94200976b0233cfe07e5887cea49 (patch)
tree014c5605c2a3b2bf2bd674fc16dedc7991044f81 /tests
parent4c618fd442a429c9c2ee4ab1c5ae13fe716eea30 (diff)
parentfd3ac0319439e3de2d7f6e97705fb1af1d66cdc4 (diff)
downloadtk-f229cc87ab8e94200976b0233cfe07e5887cea49.zip
tk-f229cc87ab8e94200976b0233cfe07e5887cea49.tar.gz
tk-f229cc87ab8e94200976b0233cfe07e5887cea49.tar.bz2
Merge trunk
Diffstat (limited to 'tests')
-rw-r--r--tests/canvText.test4
-rw-r--r--tests/focus.test10
-rw-r--r--tests/pack.test5
-rw-r--r--tests/place.test6
-rw-r--r--tests/send.test5
-rw-r--r--tests/textDisp.test48
-rw-r--r--tests/ttk/combobox.test2
-rw-r--r--tests/ttk/entry.test4
-rw-r--r--tests/ttk/image.test2
-rw-r--r--tests/ttk/labelframe.test8
-rw-r--r--tests/ttk/notebook.test4
-rw-r--r--tests/ttk/panedwindow.test8
-rw-r--r--tests/ttk/progressbar.test2
-rw-r--r--tests/ttk/scrollbar.test2
-rw-r--r--tests/ttk/treetags.test2
-rw-r--r--tests/ttk/treeview.test34
-rw-r--r--tests/ttk/ttk.test36
-rw-r--r--tests/wm.test14
18 files changed, 105 insertions, 91 deletions
diff --git a/tests/canvText.test b/tests/canvText.test
index da60ea4..f39c7f2 100644
--- a/tests/canvText.test
+++ b/tests/canvText.test
@@ -11,6 +11,8 @@ namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+
# Canvas used in 1.* - 17.* tests
canvas .c -width 400 -height 300 -bd 2 -relief sunken
pack .c
@@ -940,7 +942,7 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup
destroy .c
} -result {{Yeah } Yeah- 4 4}
-test canvText-20.1 {angled text bounding box} -setup {
+test canvText-20.1 {angled text bounding box} -constraints failsOnUbuntu -setup {
destroy .c
canvas .c
proc transpose {bbox} {
diff --git a/tests/focus.test b/tests/focus.test
index 7da289d..20d25eb 100644
--- a/tests/focus.test
+++ b/tests/focus.test
@@ -11,6 +11,8 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+
proc focusSetup {} {
destroy .t
toplevel .t
@@ -308,7 +310,7 @@ in .t.b1 NotifyNonlinear
} .t.b1}
test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} -constraints {
- unix testwrapper
+ unix testwrapper failsOnUbuntu
} -body {
focus .t.b1
focus .
@@ -320,7 +322,7 @@ test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} -constraints {
list $x $focusInfo
} -result {.t.b1 {press .t.b1 x}}
test focus-2.7 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
- unix testwrapper
+ unix testwrapper failsOnUbuntu
} -body {
set result {}
foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear
@@ -341,7 +343,7 @@ test focus-2.8 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
focus
} -result {.t.b1}
test focus-2.9 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
- unix testwrapper
+ unix testwrapper failsOnUbuntu
} -body {
focus .t.b1
event gen [testwrapper .] <FocusOut> -detail NotifyAncestor
@@ -599,7 +601,7 @@ cleanupbg
# Test 5.1 fails (before and after update)
test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} -constraints {
- unix testwrapper secureserver
+ unix testwrapper secureserver failsOnUbuntu
} -body {
setupbg
focusSetup
diff --git a/tests/pack.test b/tests/pack.test
index 5c919ed..02008c7 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -11,6 +11,7 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
# Create some test windows.
@@ -1542,7 +1543,7 @@ if {[tk windowingsystem] == "win32"} {
}
test pack-18.1 {unmap content when container unmapped} -constraints {
- tempNotPc
+ tempNotPc failsOnUbuntu
} -setup {
eval destroy [winfo child .pack]
} -body {
@@ -1572,7 +1573,7 @@ test pack-18.1 {unmap content when container unmapped} -constraints {
lappend result [winfo ismapped .pack.a]
} -result {1 0 200 75 0 1}
-test pack-18.2 {unmap content when container unmapped} -setup {
+test pack-18.2 {unmap content when container unmapped} -constraints failsOnUbuntu -setup {
eval destroy [winfo child .pack]
} -body {
# adjust the position of .pack before test to avoid a screen switch
diff --git a/tests/place.test b/tests/place.test
index e811b1a..3ef1de7 100644
--- a/tests/place.test
+++ b/tests/place.test
@@ -13,6 +13,8 @@ tcltest::loadTestedCommands
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+
# XXX - This test file is woefully incomplete. At present, only a
# few of the features are tested.
@@ -267,7 +269,7 @@ if {[tk windowingsystem] == "win32"} {
}
}
-test place-8.1 {PlaceStructureProc, mapping and unmapping content} -setup {
+test place-8.1 {PlaceStructureProc, mapping and unmapping content} -constraints failsOnUbuntu -setup {
place forget .t.f2
place forget .t.f
} -body {
@@ -283,7 +285,7 @@ test place-8.1 {PlaceStructureProc, mapping and unmapping content} -setup {
placeUpdate
lappend result [winfo ismapped .t.f2]
} -result {1 0 40 30 0 1}
-test place-8.2 {PlaceStructureProc, mapping and unmapping content} -setup {
+test place-8.2 {PlaceStructureProc, mapping and unmapping content} -constraints failsOnUbuntu -setup {
place forget .t.f2
place forget .t.f
update idletasks
diff --git a/tests/send.test b/tests/send.test
index 9c4cf04..d3322e5 100644
--- a/tests/send.test
+++ b/tests/send.test
@@ -15,6 +15,7 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
testConstraint xhost [llength [auto_execok xhost]]
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
# Compute a script that will load Tk into a child interpreter.
@@ -286,7 +287,7 @@ test send-8.14 {Tk_SendCmd procedure, local interp killed by send} {secureserver
catch {interp delete t_s_2}
-test send-8.15 {Tk_SendCmd procedure, local interp, error info} {secureserver testsend} {
+test send-8.15 {Tk_SendCmd procedure, local interp, error info} {secureserver testsend failsOnUbuntu} {
catch {error foo}
list [catch {send t_s_1 {if 1 {open bogus_file_name}}} msg] $msg $errorInfo $errorCode
} {1 {couldn't open "bogus_file_name": no such file or directory} {couldn't open "bogus_file_name": no such file or directory
@@ -296,7 +297,7 @@ test send-8.15 {Tk_SendCmd procedure, local interp, error info} {secureserver te
"if 1 {open bogus_file_name}"
invoked from within
"send t_s_1 {if 1 {open bogus_file_name}}"} {POSIX ENOENT {no such file or directory}}}
-test send-8.16 {Tk_SendCmd procedure, bogusCommWindow} {secureserver testsend} {
+test send-8.16 {Tk_SendCmd procedure, bogusCommWindow} {secureserver testsend failsOnUbuntu} {
testsend prop root InterpRegistry "10234 bogus\n"
set result [list [catch {send bogus bogus command} msg] $msg]
winfo interps
diff --git a/tests/textDisp.test b/tests/textDisp.test
index a5fe324..4b85646 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -109,6 +109,8 @@ wm positionfrom . user
wm deiconify .
updateText
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+
# Some window managers (like olwm under SunOS 4.1.3) misbehave in a way
# that tends to march windows off the top and left of the screen. If
# this happens, some tests will fail because parts of the window will
@@ -285,7 +287,7 @@ test textDisp-2.5 {LayoutDLine, word wrap} {textfonts} {
.t insert 1.0 "This isx some sample text for testing."
list [.t bbox 1.13] [.t bbox 1.19] [.t bbox 1.20] [.t bbox 1.21]
} [list [list 96 5 $fixedWidth $fixedHeight] [list 138 5 $fixedWidth $fixedHeight] [list 145 5 0 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] $fixedWidth $fixedHeight]]
-test textDisp-2.6 {LayoutDLine, word wrap} {
+test textDisp-2.6 {LayoutDLine, word wrap} failsOnUbuntu {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This isxxx some sample text for testing."
@@ -1188,7 +1190,7 @@ test textDisp-8.9 {TkTextChanged} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 8.0} {2.0 8.0}}
-test textDisp-8.10 {TkTextChanged} {
+test textDisp-8.10 {TkTextChanged} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
@@ -1248,7 +1250,7 @@ test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} {
update idletasks
} {}
-test textDisp-9.1 {TkTextRedrawTag} {
+test textDisp-9.1 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1266,7 +1268,7 @@ test textDisp-9.2 {TkTextRedrawTag} {textfonts} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{1.0 2.0 2.17} {1.0 2.0 2.17}}
-test textDisp-9.3 {TkTextRedrawTag} {
+test textDisp-9.3 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1277,7 +1279,7 @@ test textDisp-9.3 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
-test textDisp-9.4 {TkTextRedrawTag} {
+test textDisp-9.4 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1288,7 +1290,7 @@ test textDisp-9.4 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
-test textDisp-9.5 {TkTextRedrawTag} {
+test textDisp-9.5 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1299,7 +1301,7 @@ test textDisp-9.5 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
-test textDisp-9.6 {TkTextRedrawTag} {
+test textDisp-9.6 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap"
@@ -1310,7 +1312,7 @@ test textDisp-9.6 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}}
-test textDisp-9.7 {TkTextRedrawTag} {
+test textDisp-9.7 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
@@ -1868,7 +1870,7 @@ test textDisp-14.5 {TkTextXviewCmd procedure} {
test textDisp-14.6 {TkTextXviewCmd procedure} {
list [catch {.t xview moveto a} msg] $msg
} {1 {expected floating-point number but got "a"}}
-test textDisp-14.7 {TkTextXviewCmd procedure} {
+test textDisp-14.7 {TkTextXviewCmd procedure} failsOnUbuntu {
.t delete 1.0 end
.t insert end xxxxxxxxx\n
.t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
@@ -2068,7 +2070,7 @@ test textDisp-16.9 {TkTextYviewCmd procedure, "moveto" option} {
test textDisp-16.10 {TkTextYviewCmd procedure, "moveto" option} {
list [catch {.t yview moveto gorp} msg] $msg
} {1 {expected floating-point number but got "gorp"}}
-test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} {
+test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto 0.5
.t index @0,0
} {103.0}
@@ -2080,21 +2082,21 @@ test textDisp-16.13 {TkTextYviewCmd procedure, "moveto" option} {
.t yview moveto 1.1
.t index @0,0
} {191.0}
-test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} {
+test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto .75
.t index @0,0
} {151.60}
-test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} {
+test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto .752
.t index @0,0
} {151.60}
-test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} {textfonts} {
+test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} textfonts {
set count [expr {5 * $bigHeight + 150 * $fixedHeight}]
set extra [expr {0.04 * double($fixedDiff * 150) / double($count)}]
.t yview moveto [expr {.753 - $extra}]
.t index @0,0
} {151.60}
-test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} {
+test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto .755
.t index @0,0
} {151.80}
@@ -2258,7 +2260,7 @@ test textDisp-16.38 {TkTextYviewCmd procedure} {
test textDisp-16.39 {TkTextYviewCmd procedure} {
list [catch {.t yview scroll 1.3i pixels} msg] $msg
} {0 {}}
-test textDisp-16.40 {text count -xpixels} {
+test textDisp-16.40 {text count -xpixels} failsOnUbuntu {
set res {}
lappend res [.t count -xpixels 1.0 1.5] \
[.t count -xpixels 1.5 1.0] \
@@ -2570,7 +2572,7 @@ test textDisp-19.7 {GetYView procedure} {
updateText
set x $scrollInfo
} {0.125 0.75}
-test textDisp-19.8 {GetYView procedure} {
+test textDisp-19.8 {GetYView procedure} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
@@ -2867,7 +2869,7 @@ test textDisp-19.16 {count -ypixels} {
[.t count -ypixels 16.0 "16.0 displaylineend +1c"] \
[.t count -ypixels "16.0 +1 displaylines" "16.0 +4 displaylines +3c"]
} [list [expr {260 + 20 * $fixedDiff}] [expr {260 + 20 * $fixedDiff}] $fixedHeight [expr {2*$fixedHeight}] $fixedHeight [expr {3*$fixedHeight}]]
-test textDisp-19.17 {count -ypixels with indices in elided lines} {
+test textDisp-19.17 {count -ypixels with indices in elided lines} failsOnUbuntu {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -2894,7 +2896,7 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} {
.t yview 35.0
lappend res [.t count -ypixels 5.0 25.0]
} [list [expr {4 * $fixedHeight}] [expr {3 * $fixedHeight}] 0 0 0 0 0 0 [expr {5 * $fixedHeight}] [expr {- 5 * $fixedHeight}] [expr {2 * $fixedHeight}] [expr {3 * $fixedHeight}] [expr {5 * $fixedHeight}]]
-test textDisp-19.18 {count -ypixels with indices in elided lines} {
+test textDisp-19.18 {count -ypixels with indices in elided lines} failsOnUbuntu {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -3933,7 +3935,7 @@ catch {destroy .t2}
.t configure -height 1
updateText
-test textDisp-31.1 {line embedded window height update} {
+test textDisp-31.1 {line embedded window height update} failsOnUbuntu {
set res {}
.t delete 1.0 end
.t insert end "abcd\nefgh\nijkl\nmnop\nqrst\nuvwx\nyx"
@@ -3946,7 +3948,7 @@ test textDisp-31.1 {line embedded window height update} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]]
-test textDisp-31.2 {line update index shifting} {
+test textDisp-31.2 {line update index shifting} failsOnUbuntu {
set res {}
.t.f configure -height 100
updateText
@@ -3963,7 +3965,7 @@ test textDisp-31.2 {line update index shifting} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
-test textDisp-31.3 {line update index shifting} {
+test textDisp-31.3 {line update index shifting} failsOnUbuntu {
# Should do exactly the same as the above, as long
# as we are correctly tagging the correct lines for
# recalculation. The 'update' and 'delay' must be
@@ -4000,7 +4002,7 @@ test textDisp-31.4 {line embedded image height update} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]]
-test textDisp-31.5 {line update index shifting} {
+test textDisp-31.5 {line update index shifting} failsOnUbuntu {
set res {}
textest configure -height 100
updateText
@@ -4017,7 +4019,7 @@ test textDisp-31.5 {line update index shifting} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
-test textDisp-31.6 {line update index shifting} {
+test textDisp-31.6 {line update index shifting} failsOnUbuntu {
# Should do exactly the same as the above, as long
# as we are correctly tagging the correct lines for
# recalculation. The 'update' and 'delay' must be
diff --git a/tests/ttk/combobox.test b/tests/ttk/combobox.test
index ef77adb..48179f3 100644
--- a/tests/ttk/combobox.test
+++ b/tests/ttk/combobox.test
@@ -13,7 +13,7 @@ test combobox-1.0 "Combobox tests -- setup" -body {
test combobox-1.1 "Bad -values list" -body {
.cb configure -values "bad \{list"
-} -result "unmatched open brace in list" -returnCodes 1
+} -result "unmatched open brace in list" -returnCodes error
test combobox-1.end "Combobox tests -- cleanup" -body {
destroy .cb
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index 5eb4740..a958d90 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -7,6 +7,8 @@ package require tcltest 2.2
namespace import -force tcltest::*
loadTestedCommands
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+
variable scrollInfo
proc scroll args {
global scrollInfo
@@ -75,7 +77,7 @@ test entry-2.1 "Create entry before scrollbar" -body {
-expand false -fill x
} -cleanup {destroy .te .tsb}
-test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body {
+test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constraints failsOnUbuntu -body {
pack [ttk::entry .te -xscrollcommand [list .tsb set]] \
-expand true -fill both
.te insert end [string repeat "abc" 50]
diff --git a/tests/ttk/image.test b/tests/ttk/image.test
index ea0ab1d..bb593fc 100644
--- a/tests/ttk/image.test
+++ b/tests/ttk/image.test
@@ -12,7 +12,7 @@ test image-1.2 "Duplicate element" -setup {
ttk::style element create testElement image test.element
} -body {
ttk::style element create testElement image test.element
-} -returnCodes 1 -result "Duplicate element testElement"
+} -returnCodes error -result "Duplicate element testElement"
test image-2.0 "Deletion of displayed image (label)" -setup {
image create photo test.image -width 10 -height 10
diff --git a/tests/ttk/labelframe.test b/tests/ttk/labelframe.test
index 1f64d67..9ffffd8 100644
--- a/tests/ttk/labelframe.test
+++ b/tests/ttk/labelframe.test
@@ -11,22 +11,22 @@ test labelframe-2.1 "Can't use indirect descendant as labelwidget" -body {
ttk::frame .lf.t
ttk::checkbutton .lf.t.cb
.lf configure -labelwidget .lf.t.cb
-} -returnCodes 1 -result "can't *" -match glob \
+} -returnCodes error -result "can't *" -match glob \
-cleanup { destroy .lf.t } ;
test labelframe-2.2 "Can't use toplevel as labelwidget" -body {
toplevel .lf.t
.lf configure -labelwidget .lf.t
-} -returnCodes 1 -result "can't *" -match glob \
+} -returnCodes error -result "can't *" -match glob \
-cleanup { destroy .lf.t } ;
test labelframe-2.3 "Can't use non-windows as -labelwidget" -body {
.lf configure -labelwidget BogusWindowName
-} -returnCodes 1 -result {bad window path name "BogusWindowName"}
+} -returnCodes error -result {bad window path name "BogusWindowName"}
test labelframe-2.4 "Can't use nonexistent-windows as -labelwidget" -body {
.lf configure -labelwidget .nosuchwindow
-} -returnCodes 1 -result {bad window path name ".nosuchwindow"}
+} -returnCodes error -result {bad window path name ".nosuchwindow"}
###
diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test
index fbab6bd..e58812a 100644
--- a/tests/ttk/notebook.test
+++ b/tests/ttk/notebook.test
@@ -25,11 +25,11 @@ test notebook-1.3 "Cannot add toplevel" -body {
.nb add [toplevel .nb.t]
} -cleanup {
destroy .t.nb
-} -returnCodes 1 -match glob -result "can't add .nb.t*"
+} -returnCodes error -match glob -result "can't add .nb.t*"
test notebook-1.4 "Try to select bad tab" -body {
.nb select @6000,6000
-} -returnCodes 1 -match glob -result "* not found"
+} -returnCodes error -match glob -result "* not found"
#
# Now add stuff:
diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test
index 9d3cf77..528d56b 100644
--- a/tests/ttk/panedwindow.test
+++ b/tests/ttk/panedwindow.test
@@ -47,7 +47,7 @@ test panedwindow-1.7 "Make sure empty panedwindow still still doesn't crash" -bo
test panedwindow-1.8 "Re-forget pane" -body {
.pw forget .pw.f1
-} -returnCodes 1 -result ".pw.f1 is not managed by .pw"
+} -returnCodes error -result ".pw.f1 is not managed by .pw"
test panedwindow-1.end "Cleanup" -body {
destroy .pw
@@ -119,11 +119,11 @@ test panedwindow-3.0 "configure pane" -body {
test panedwindow-3.1 "configure pane -- errors" -body {
.pw pane 1 -weight -4
-} -returnCodes 1 -match glob -result "-weight must be nonnegative"
+} -returnCodes error -match glob -result "-weight must be nonnegative"
test panedwindow-3.2 "add pane -- errors" -body {
.pw add [ttk::label .pw.l] -weight -1
-} -returnCodes 1 -match glob -result "-weight must be nonnegative"
+} -returnCodes error -match glob -result "-weight must be nonnegative"
test panedwindow-3.end "cleanup" -body { destroy .pw }
@@ -147,7 +147,7 @@ test panedwindow-4.1 "forget" -body {
test panedwindow-4.2 "forget forgotten" -body {
.pw forget .pw.l1
-} -returnCodes 1 -result ".pw.l1 is not managed by .pw"
+} -returnCodes error -result ".pw.l1 is not managed by .pw"
# checkorder $winlist --
# Ensure that Y coordinates windows in $winlist are strictly increasing.
diff --git a/tests/ttk/progressbar.test b/tests/ttk/progressbar.test
index d3886e7..8e2fdb9 100644
--- a/tests/ttk/progressbar.test
+++ b/tests/ttk/progressbar.test
@@ -77,7 +77,7 @@ test progressbar-2.5 "error in write trace" -body {
trace variable PB w { error "YIPES!" ;# }
.pb step
set PB ;# NOTREACHED
-} -cleanup { unset PB } -returnCodes 1 -match glob -result "*YIPES!"
+} -cleanup { unset PB } -returnCodes error -match glob -result "*YIPES!"
test progressbar-end "Cleanup" -body {
destroy .pb
diff --git a/tests/ttk/scrollbar.test b/tests/ttk/scrollbar.test
index 2e49b27..75d11e7 100644
--- a/tests/ttk/scrollbar.test
+++ b/tests/ttk/scrollbar.test
@@ -124,7 +124,7 @@ test scale-1.0 "Self-destruction" -body {
ttk::scale .s -variable v
pack .s ; update
.s set 1 ; update
-} -returnCodes 1 -match glob -result "*"
+} -returnCodes error -match glob -result "*"
test scale-2.1 "-state option" -setup {
ttk::scale .s
diff --git a/tests/ttk/treetags.test b/tests/ttk/treetags.test
index 0de6df5..d7fa23a 100644
--- a/tests/ttk/treetags.test
+++ b/tests/ttk/treetags.test
@@ -171,7 +171,7 @@ test treetags-2.3 "Virtual events delivered to focus item" -body {
test treetags-2.4 "Bad events" -body {
$tv tag bind bad <Enter> { puts "Entered!" }
-} -returnCodes 1 -result "unsupported event <Enter>*" -match glob
+} -returnCodes error -result "unsupported event <Enter>*" -match glob
test treetags-3.0 "tag configure - set" -body {
$tv tag configure tag1 -foreground blue -background red
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test
index 522e3a8..8e31fe9 100644
--- a/tests/ttk/treeview.test
+++ b/tests/ttk/treeview.test
@@ -46,33 +46,33 @@ test treeview-1.1 "columns" -body {
test treeview-1.2 "Bad columns" -body {
#.tv configure -columns {illegal "list"value}
ttk::treeview .badtv -columns {illegal "list"value}
-} -returnCodes 1 -result "list element in quotes followed by*" -match glob
+} -returnCodes error -result "list element in quotes followed by*" -match glob
test treeview-1.3 "bad displaycolumns" -body {
.tv configure -displaycolumns {a b d}
-} -returnCodes 1 -result "Invalid column index d"
+} -returnCodes error -result "Invalid column index d"
test treeview-1.4 "more bad displaycolumns" -body {
.tv configure -displaycolumns {1 2 3}
-} -returnCodes 1 -result "Column index 3 out of bounds"
+} -returnCodes error -result "Column index 3 out of bounds"
test treeview-1.5 "Don't forget to check negative numbers" -body {
.tv configure -displaycolumns {1 -2 3}
-} -returnCodes 1 -result "Column index -2 out of bounds"
+} -returnCodes error -result "Column index -2 out of bounds"
# Item creation.
#
test treeview-2.1 "insert -- not enough args" -body {
.tv insert
-} -returnCodes 1 -result "wrong # args: *" -match glob
+} -returnCodes error -result "wrong # args: *" -match glob
test treeview-2.3 "insert -- bad integer index" -body {
.tv insert {} badindex
-} -returnCodes 1 -result "expected integer *" -match glob
+} -returnCodes error -result "expected integer *" -match glob
test treeview-2.4 "insert -- bad parent node" -body {
.tv insert badparent end
-} -returnCodes 1 -result "Item badparent not found" -match glob
+} -returnCodes error -result "Item badparent not found" -match glob
test treeview-2.5 "insert -- finaly insert a node" -body {
.tv insert {} end -id newnode -text "New node"
@@ -84,7 +84,7 @@ test treeview-2.6 "insert -- make sure node was inserted" -body {
test treeview-2.7 "insert -- prevent duplicate node names" -body {
.tv insert {} end -id newnode
-} -returnCodes 1 -result "Item newnode already exists"
+} -returnCodes error -result "Item newnode already exists"
test treeview-2.8 "insert -- new node at end" -body {
.tv insert {} end -id lastnode
@@ -126,7 +126,7 @@ test treeview-2.13 "insert -- one more at beginning" -body {
test treeview-2.14 "insert -- bad options" -body {
.tv insert {} end -badoption foo
-} -returnCodes 1 -result {unknown option "-badoption"}
+} -returnCodes error -result {unknown option "-badoption"}
test treeview-2.15 "insert -- at position 0 w/no children" -body {
.tv insert newnode 0 -id newnode.n2 -text "Foo"
@@ -202,7 +202,7 @@ test treeview-3.11 "Can't detach root item" -body {
.tv detach [list {}]
update
consistencyCheck .tv
-} -returnCodes 1 -result "Cannot detach root item"
+} -returnCodes error -result "Cannot detach root item"
consistencyCheck .tv
test treeview-3.12 "Reattach" -body {
@@ -275,7 +275,7 @@ test treeview-4.3 "opened - closed node" -body {
test treeview-5.1 "item -- error checks" -body {
.tv item newnode -text "Bad values" -values "{bad}list"
-} -returnCodes 1 -result "list element in braces followed by*" -match glob
+} -returnCodes error -result "list element in braces followed by*" -match glob
test treeview-5.2 "item -- error leaves options unchanged " -body {
.tv item newnode -text
@@ -298,11 +298,11 @@ test treeview-5.5 "set cell" -body {
test treeview-5.6 "set illegal cell" -body {
.tv set newnode #0 YYY
-} -returnCodes 1 -result "Display column #0 cannot be set"
+} -returnCodes error -result "Display column #0 cannot be set"
test treeview-5.7 "set illegal cell" -body {
.tv set newnode 3 YY ;# 3 == current #columns
-} -returnCodes 1 -result "Column index 3 out of bounds"
+} -returnCodes error -result "Column index 3 out of bounds"
test treeview-5.8 "set display columns" -body {
.tv configure -displaycolumns [list 2 1 0]
@@ -318,7 +318,7 @@ test treeview-5.9 "display columns part 2" -body {
test treeview-5.10 "cannot set column -id" -body {
.tv column #1 -id X
-} -returnCodes 1 -result "Attempt to change read-only option"
+} -returnCodes error -result "Attempt to change read-only option"
test treeview-5.11 "get" -body {
.tv set newnode #1
@@ -406,7 +406,7 @@ test treeview-7.1 "move" -body {
test treeview-7.2 "illegal move" -body {
.tv move d d2 end
-} -returnCodes 1 -result "Cannot insert d as descendant of d2"
+} -returnCodes error -result "Cannot insert d as descendant of d2"
test treeview-7.3 "illegal move has no effect" -body {
consistencyCheck .tv
@@ -427,7 +427,7 @@ test treeview-7.5 "replace children - precondition" -body {
test treeview-7.6 "Replace children - illegal move" -body {
.tv children newnode.n1 [list newnode.n1 newnode.n2 newnode.n3]
-} -returnCodes 1 -result "Cannot insert newnode.n1 as descendant of newnode.n1"
+} -returnCodes error -result "Cannot insert newnode.n1 as descendant of newnode.n1"
consistencyCheck .tv
@@ -458,7 +458,7 @@ test treeview-8.4 "Selection - clear" -body {
test treeview-8.5 "Selection - bad operation" -body {
.tv selection badop foo
-} -returnCodes 1 -match glob -result {bad selection operation "badop": must be *}
+} -returnCodes error -match glob -result {bad selection operation "badop": must be *}
test treeview-8.6 "Selection - <<TreeviewSelect>> on selection add" -body {
.tv selection set {}
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index ec1a3b6..fdd3eae 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -32,7 +32,7 @@ test ttk-6.1 "Self-destructing checkbutton" -body {
trace variable sd w [list selfdestruct .sd]
update
.sd invoke
-} -returnCodes 1
+} -returnCodes error
test ttk-6.2 "Checkbutton self-destructed" -body {
winfo exists .sd
} -result 0
@@ -146,7 +146,7 @@ test ttk-1.2 "Check style" -body {
test ttk-1.3 "Set bad style" -body {
.t configure -style "nosuchstyle"
-} -returnCodes 1 -result {Layout nosuchstyle not found}
+} -returnCodes error -result {Layout nosuchstyle not found}
test ttk-1.4 "Original style preserved" -body {
.t cget -style
@@ -235,11 +235,11 @@ foreach wc $widgetClasses {
# misc. error detection
test ttk-3.0 "Bad option" -body {
ttk::button .bad -badoption foo
-} -returnCodes 1 -result {unknown option "-badoption"} -match glob
+} -returnCodes error -result {unknown option "-badoption"} -match glob
test ttk-3.1 "Make sure widget command not created" -body {
.bad state disabled
-} -returnCodes 1 -result {invalid command name ".bad"} -match glob
+} -returnCodes error -result {invalid command name ".bad"} -match glob
test ttk-3.2 "Propagate errors from variable traces" -body {
set A 0
@@ -252,7 +252,7 @@ test ttk-3.2 "Propagate errors from variable traces" -body {
test ttk-3.3 "Constructor failure with cursor" -body {
ttk::button .b -cursor bottom_right_corner -style BadStyle
-} -returnCodes 1 -result "Layout BadStyle not found"
+} -returnCodes error -result "Layout BadStyle not found"
test ttk-3.4 "SF#2009213" -body {
ttk::style configure TScale -sliderrelief {}
@@ -388,12 +388,12 @@ test ttk-8.4 "ImageChanged" -body {
test ttk-9.1 "Traces on nonexistant namespaces" -body {
ttk::checkbutton .tcb -variable foo::bar
-} -returnCodes 1 -result "*parent namespace doesn't exist*" -match glob
+} -returnCodes error -result "*parent namespace doesn't exist*" -match glob
test ttk-9.2 "Traces on nonexistant namespaces II" -body {
ttk::checkbutton .tcb -variable X
.tcb configure -variable foo::bar
-} -returnCodes 1 -result "*parent namespace doesn't exist*" -match glob
+} -returnCodes error -result "*parent namespace doesn't exist*" -match glob
test ttk-9.3 "Restore saved options on configure error" -body {
.tcb cget -variable
@@ -458,7 +458,7 @@ test ttk-10.3 "Check class resource" -body {
test ttk-10.4 "Try to modify class resource" -body {
.f configure -class Bar
-} -returnCodes 1 -match glob -result "*read-only option*"
+} -returnCodes error -match glob -result "*read-only option*"
test ttk-10.5 "Check class resource again" -body {
.f cget -class
@@ -548,14 +548,14 @@ test ttk-12.4 "-borderwidth frame option" -body {
test ttk-13.1 "Custom styles -- bad -style option" -body {
ttk::button .tb1 -style badstyle
-} -returnCodes 1 -result "*badstyle not found*" -match glob
+} -returnCodes error -result "*badstyle not found*" -match glob
test ttk-13.4 "Custom styles -- bad -style option" -body {
ttk::button .tb1
.tb1 configure -style badstyle
} -cleanup {
destroy .tb1
-} -returnCodes 1 -result "*badstyle not found*" -match glob
+} -returnCodes error -result "*badstyle not found*" -match glob
test ttk-13.5 "Custom layouts -- missing element definition" -body {
ttk::style layout badstyle {
@@ -573,17 +573,17 @@ test ttk-13.5 "Custom layouts -- missing element definition" -body {
test ttk-14.1 "-variable in nonexistant namespace" -body {
ttk::checkbutton .tw -variable ::nsn::foo
-} -returnCodes 1 -result {can't trace *: parent namespace doesn't exist} \
+} -returnCodes error -result {can't trace *: parent namespace doesn't exist} \
-match glob -cleanup { destroy .tw }
test ttk-14.2 "-textvariable in nonexistant namespace" -body {
ttk::label .tw -textvariable ::nsn::foo
-} -returnCodes 1 -result {can't trace *: parent namespace doesn't exist} \
+} -returnCodes error -result {can't trace *: parent namespace doesn't exist} \
-match glob -cleanup { destroy .tw }
test ttk-14.3 "-textvariable in nonexistant namespace" -body {
ttk::entry .tw -textvariable ::nsn::foo
-} -returnCodes 1 -result {can't trace *: parent namespace doesn't exist} \
+} -returnCodes error -result {can't trace *: parent namespace doesn't exist} \
-match glob -cleanup { destroy .tw }
test ttk-15.1 {Bug 3062331} -setup {
@@ -629,27 +629,27 @@ proc wrong#varargs {varpart args} {
test ttk-ensemble-0 "style element create: insufficient args" -body {
ttk::style
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs arg ttk::style option]
test ttk-ensemble-1 "style element create: insufficient args" -body {
ttk::style element
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs arg ttk::style element option]
test ttk-ensemble-2 "style element create: insufficient args" -body {
ttk::style element create
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs {-option value} ttk::style element create name type]
test ttk-ensemble-3 "style element create: insufficient args" -body {
ttk::style element create plain.background
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs {-option value} ttk::style element create name type]
test ttk-ensemble-4 "style element create: insufficient args" -body {
ttk::style element create plain.background from
-} -returnCodes 1 -result [wrong#args theme ?element?]
+} -returnCodes error -result [wrong#args theme ?element?]
test ttk-ensemble-5 "style element create: valid" -body {
ttk::style element create plain.background from default
diff --git a/tests/wm.test b/tests/wm.test
index 6d5e73b..4c0da3e 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -27,6 +27,8 @@ proc stdWindow {} {
update
}
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+
# [raise] and [lower] may return before the window manager has completed the
# operation. The raiseDelay procedure idles for a while to give the operation
# a chance to complete.
@@ -807,7 +809,7 @@ test wm-iconify-2.4.2 {Misc errors} -constraints !win -setup {
destroy .t2 .r.f
} -result {can't iconify ".t2": it is an embedded window}
-test wm-iconify-3.1 {iconify behavior} -body {
+test wm-iconify-3.1 {iconify behavior} -constraints failsOnUbuntu -body {
toplevel .t2
wm geom .t2 -0+0
update idletasks
@@ -1415,7 +1417,7 @@ test wm-stackorder-2.7 {stacking order: no children returns self} -setup {
deleteWindows
-test wm-stackorder-3.1 {unmapped toplevel} -body {
+test wm-stackorder-3.1 {unmapped toplevel} -constraints failsOnUbuntu -body {
toplevel .t1 ; update
toplevel .t2 ; update
wm iconify .t1
@@ -1750,7 +1752,7 @@ test wm-transient-4.2 {already mapped transient toplevel
deleteWindows
} -result {withdrawn 0}
test wm-transient-4.3 {iconify/deiconify on the toplevel
- does a withdraw/deiconify on the transient} -setup {
+ does a withdraw/deiconify on the transient} -constraints failsOnUbuntu -setup {
set results [list]
} -body {
toplevel .top
@@ -1926,7 +1928,7 @@ test wm-transient-7.5 {Reassign transient, destroy transient} -body {
deleteWindows
}
-test wm-transient-8.1 {transient to withdrawn window, Bug 1163496} -setup {
+test wm-transient-8.1 {transient to withdrawn window, Bug 1163496} -constraints failsOnUbuntu -setup {
deleteWindows
set result {}
} -body {
@@ -2003,7 +2005,7 @@ test wm-state-2.7 {state change before map} -body {
} -cleanup {
deleteWindows
} -result {iconic}
-test wm-state-2.8 {state change after map} -body {
+test wm-state-2.8 {state change after map} -constraints failsOnUbuntu -body {
toplevel .t
update
wm state .t iconic
@@ -2011,7 +2013,7 @@ test wm-state-2.8 {state change after map} -body {
} -cleanup {
deleteWindows
} -result {iconic}
-test wm-state-2.9 {state change after map} -body {
+test wm-state-2.9 {state change after map} -constraints failsOnUbuntu -body {
toplevel .t
update
wm iconify .t