From 65aca680324e7b415909f2e6e003862bdf641f05 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Oct 2022 21:01:59 +0000 Subject: Backout previous commit, i.e. remove again constraints on unixEmbed-10.1 and unixEmbed-10.2, so that these tests can run at Github Actions even if they are failing sometimes. --- tests/unixEmbed.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 80ea671..669ef40 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1242,7 +1242,7 @@ test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constrain test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints { - unix failsOnUbuntu failsOnXQuarz + unix } -setup { deleteWindows } -body { @@ -1257,7 +1257,7 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con deleteWindows } -result {150x80+0+0} test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints { - unix failsOnUbuntu failsOnXQuarz + unix } -setup { deleteWindows } -body { -- cgit v0.12 From b0c5eb5d8a193af402153f90a4f0939056f6d1fa Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 19:16:05 +0000 Subject: Remove an 'update idletasks' from the setup phase in frame-12.3. This was added in [cb5da4af7b] for no stated reason. --- tests/frame.test | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/frame.test b/tests/frame.test index 01b4687..bdd7902 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -1162,7 +1162,6 @@ test frame-12.2 {FrameWorldChanged procedure} -setup { } -result {1 1 1 1 1 1 1 1 1 1 1 1} test frame-12.3 {FrameWorldChanged procedure} -setup { deleteWindows - update idletasks } -body { # Check reaction on font change font create myfont -family courier -size 10 -- cgit v0.12 From 976202eb66dad9ab73d6d87a11eb455f62137dc1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 19:17:28 +0000 Subject: Fix indentation in frame.test --- tests/frame.test | 136 +++++++++++++++++++++++++++---------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index bdd7902..0a79844 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -54,7 +54,7 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} { test frame-1.1 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { frame .f -class NewFrame .f configure -class @@ -71,7 +71,7 @@ test frame-1.2 {frame configuration options} -setup { } -returnCodes error -result {can't modify -class option after widget is created} test frame-1.3 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { frame .f -colormap new .f configure -colormap @@ -88,7 +88,7 @@ test frame-1.4 {frame configuration options} -setup { } -returnCodes error -result {can't modify -colormap option after widget is created} test frame-1.5 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { frame .f -visual default .f configure -visual @@ -105,14 +105,14 @@ test frame-1.6 {frame configuration options} -setup { } -returnCodes error -result {can't modify -visual option after widget is created} test frame-1.7 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { frame .f -screen bogus } -cleanup { deleteWindows } -returnCodes error -result {unknown option "-screen"} test frame-1.8 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { frame .f -container true } -cleanup { @@ -127,14 +127,14 @@ test frame-1.9 {frame configuration options} -setup { deleteWindows } -result {-container container Container 0 1} test frame-1.10 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { frame .f -container bogus } -cleanup { deleteWindows } -returnCodes error -result {expected boolean value but got "bogus"} test frame-1.11 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { frame .f .f configure -container 1 @@ -142,7 +142,7 @@ test frame-1.11 {frame configuration options} -setup { deleteWindows } -returnCodes error -result {can't modify -container option after widget is created} test frame-1.12 {frame configuration options} -setup { - deleteWindows + deleteWindows } -body { # Make sure all options can be set to the default value frame .f @@ -287,7 +287,7 @@ destroy .f test frame-2.1 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 200 -height 100 -class NewClass wm geometry .t +0+0 @@ -306,7 +306,7 @@ test frame-2.2 {toplevel configuration options} -setup { } -returnCodes error -result {can't modify -class option after widget is created} test frame-2.3 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 200 -height 100 -colormap new wm geometry .t +0+0 @@ -325,7 +325,7 @@ test frame-2.4 {toplevel configuration options} -setup { } -returnCodes error -result {can't modify -colormap option after widget is created} test frame-2.5 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 @@ -346,7 +346,7 @@ test frame-2.6 {toplevel configuration options} -setup { } -result {-container container Container 0 0} test frame-2.7 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 200 -height 100 -colormap bogus } -cleanup { @@ -357,7 +357,7 @@ test frame-2.7 {toplevel configuration options} -setup { test frame-2.8 {toplevel configuration options} -constraints { win } -setup { - deleteWindows + deleteWindows } -body { catch {destroy .t} toplevel .t -width 200 -height 100 @@ -395,7 +395,7 @@ test frame-2.10 {toplevel configuration options} -constraints { test frame-2.11 {toplevel configuration options} -constraints { nonwin } -setup { - deleteWindows + deleteWindows } -body { catch {destroy .t} toplevel .t -width 200 -height 100 @@ -407,7 +407,7 @@ test frame-2.11 {toplevel configuration options} -constraints { } -result {-use use Use {} {}} test frame-2.12 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { catch {destroy .t} toplevel .t -width 200 -height 100 -visual default @@ -428,14 +428,14 @@ test frame-2.13 {toplevel configuration options} -setup { } -returnCodes error -result {can't modify -visual option after widget is created} test frame-2.14 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 200 -height 100 -visual who_knows? } -cleanup { deleteWindows } -returnCodes error -result {unknown or ambiguous visual name "who_knows?": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default} test frame-2.15 {toplevel configuration options} -constraints haveDISPLAY -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 200 -height 100 -screen $env(DISPLAY) wm geometry .t +0+0 @@ -454,14 +454,14 @@ test frame-2.16 {toplevel configuration options} -constraints haveDISPLAY -setup } -returnCodes error -result {can't modify -screen option after widget is created} test frame-2.17 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 200 -height 100 -screen bogus } -cleanup { deleteWindows } -returnCodes error -result {couldn't connect to display "bogus"} test frame-2.18 {toplevel configuration options} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 @@ -470,7 +470,7 @@ test frame-2.18 {toplevel configuration options} -setup { deleteWindows } -returnCodes error -result {windows cannot have both the -use and the -container option set} test frame-2.19 {toplevel configuration options} -setup { - deleteWindows + deleteWindows set opts {} } -body { # Make sure all options can be set to the default value @@ -582,7 +582,7 @@ test frame-3.1 {TkCreateFrame procedure} -body { frame } -returnCodes error -result {wrong # args: should be "frame pathName ?-option value ...?"} test frame-3.2 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows frame .f } -body { .f configure -class @@ -590,7 +590,7 @@ test frame-3.2 {TkCreateFrame procedure} -setup { deleteWindows } -result {-class class Class Frame Frame} test frame-3.3 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows toplevel .t wm geometry .t +0+0 } -body { @@ -599,7 +599,7 @@ test frame-3.3 {TkCreateFrame procedure} -setup { deleteWindows } -result {-class class Class Toplevel Toplevel} test frame-3.4 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 350 -class NewClass -bg black -visual default -height 90 wm geometry .t +0+0 @@ -614,7 +614,7 @@ test frame-3.4 {TkCreateFrame procedure} -setup { # Be sure that the -class, -colormap, and -visual options are processed # before configuring the widget. test frame-3.5 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows } -body { option add *NewFrame.background #123456 frame .f -class NewFrame @@ -624,7 +624,7 @@ test frame-3.5 {TkCreateFrame procedure} -setup { option clear } -result {#123456} test frame-3.7 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows } -body { option add *NewFrame.background #332211 option add *f.class NewFrame @@ -635,7 +635,7 @@ test frame-3.7 {TkCreateFrame procedure} -setup { option clear } -result {NewFrame #332211} test frame-3.8 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows } -body { option add *Silly.background #122334 option add *f.Class Silly @@ -648,7 +648,7 @@ test frame-3.8 {TkCreateFrame procedure} -setup { test frame-3.9 {TkCreateFrame procedure, -use option} -constraints { unix } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 @@ -704,7 +704,7 @@ if {[testConstraint defaultPseudocolor8]} { test frame-3.11 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 300 -height 200 -bg #475601 wm geometry .t +0+0 @@ -716,7 +716,7 @@ test frame-3.11 {TkCreateFrame procedure} -constraints { test frame-3.12 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 300 -height 200 -bg #475601 -colormap new wm geometry .t +0+0 @@ -728,7 +728,7 @@ test frame-3.12 {TkCreateFrame procedure} -constraints { test frame-3.13 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { option add *t.class Toplevel2 option add *Toplevel2.colormap new @@ -743,7 +743,7 @@ test frame-3.13 {TkCreateFrame procedure} -constraints { test frame-3.14 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { option add *t.class Toplevel3 option add *Toplevel3.Colormap new @@ -771,7 +771,7 @@ test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -constraints { test frame-3.16 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 300 -height 200 -bg #475601 -visual default wm geometry .t +0+0 @@ -783,7 +783,7 @@ test frame-3.16 {TkCreateFrame procedure} -constraints { test frame-3.17 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 300 -height 200 -bg #475601 -visual default \ -colormap new @@ -796,7 +796,7 @@ test frame-3.17 {TkCreateFrame procedure} -constraints { test frame-3.18 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343 wm geometry .t +0+0 @@ -808,7 +808,7 @@ test frame-3.18 {TkCreateFrame procedure} -constraints { test frame-3.19 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { option add *t.class T4 option add *T4.visual {grayscale 8} @@ -823,7 +823,7 @@ test frame-3.19 {TkCreateFrame procedure} -constraints { test frame-3.20 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { set x ok option add *t.class T5 @@ -839,7 +839,7 @@ test frame-3.20 {TkCreateFrame procedure} -constraints { test frame-3.21 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + deleteWindows } -body { set x ok toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343 @@ -854,7 +854,7 @@ if {[testConstraint defaultPseudocolor8]} { } test frame-3.22 {TkCreateFrame procedure, default dimensions} -setup { - deleteWindows + deleteWindows } -body { toplevel .t wm geometry .t +0+0 @@ -881,13 +881,13 @@ test frame-3.24 {TkCreateFrame procedure} -setup { test frame-4.1 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows } -body { catch {frame .f -gorp glob} winfo exists .f } -result 0 test frame-4.2 {TkCreateFrame procedure} -setup { - deleteWindows + deleteWindows } -body { list [frame .f -width 200 -height 100] [winfo exists .f] } -cleanup { @@ -944,7 +944,7 @@ test frame-5.13 {FrameWidgetCommand procedure, configure option} -body { destroy .f test frame-6.1 {ConfigureFrame procedure} -setup { - deleteWindows + deleteWindows } -body { frame .f -width 150 list [winfo reqwidth .f] [winfo reqheight .f] @@ -952,7 +952,7 @@ test frame-6.1 {ConfigureFrame procedure} -setup { deleteWindows } -result {150 1} test frame-6.2 {ConfigureFrame procedure} -setup { - deleteWindows + deleteWindows } -body { frame .f -height 97 list [winfo reqwidth .f] [winfo reqheight .f] @@ -960,7 +960,7 @@ test frame-6.2 {ConfigureFrame procedure} -setup { deleteWindows } -result {1 97} test frame-6.3 {ConfigureFrame procedure} -setup { - deleteWindows + deleteWindows } -body { frame .f set result {} @@ -974,7 +974,7 @@ test frame-6.3 {ConfigureFrame procedure} -setup { } -result {1 1 100 180 100 180} test frame-7.1 {FrameEventProc procedure} -setup { - deleteWindows + deleteWindows } -body { frame .frame2 set result [info commands .frame2] @@ -982,7 +982,7 @@ test frame-7.1 {FrameEventProc procedure} -setup { lappend result [info commands .frame2] } -result {.frame2 {}} test frame-7.2 {FrameEventProc procedure} -setup { - deleteWindows + deleteWindows set x {} } -body { frame .f1 -bg #543210 @@ -996,7 +996,7 @@ test frame-7.2 {FrameEventProc procedure} -setup { } -result {.f1 #543210 {} {}} test frame-8.1 {FrameCmdDeletedProc procedure} -setup { - deleteWindows + deleteWindows } -body { frame .f1 rename .f1 {} @@ -1005,7 +1005,7 @@ test frame-8.1 {FrameCmdDeletedProc procedure} -setup { deleteWindows } -result {{} {}} test frame-8.2 {FrameCmdDeletedProc procedure} -setup { - deleteWindows + deleteWindows } -body { toplevel .f1 -menu .m wm geometry .f1 +0+0 @@ -1036,7 +1036,7 @@ test frame-8.2 {FrameCmdDeletedProc procedure} -setup { #} -result {{} .m} test frame-9.1 {MapFrame procedure} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 100 -height 400 wm geometry .t +0+0 @@ -1047,7 +1047,7 @@ test frame-9.1 {MapFrame procedure} -setup { deleteWindows } -result {0 1} test frame-9.2 {MapFrame procedure} -setup { - deleteWindows + deleteWindows } -body { toplevel .t -width 100 -height 400 wm geometry .t +0+0 @@ -1056,7 +1056,7 @@ test frame-9.2 {MapFrame procedure} -setup { winfo exists .t } -result {0} test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup { - deleteWindows + deleteWindows } -body { toplevel .t2 -width 200 -height 200 wm geometry .t2 +0+0 @@ -1074,7 +1074,7 @@ test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup { test frame-10.1 {frame widget vs hidden commands} -setup { - deleteWindows + deleteWindows } -body { set l [interp hidden] frame .t @@ -1087,7 +1087,7 @@ test frame-10.1 {frame widget vs hidden commands} -setup { test frame-11.1 {TkInstallFrameMenu} -setup { - deleteWindows + deleteWindows } -body { menu .m1 .m1 add cascade -menu .m1.system @@ -1098,7 +1098,7 @@ test frame-11.1 {TkInstallFrameMenu} -setup { deleteWindows } -result {.t} test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup { - deleteWindows + deleteWindows } -body { catch {rename foo {}} menu .m1 @@ -1113,7 +1113,7 @@ test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup { test frame-12.1 {FrameWorldChanged procedure} -setup { - deleteWindows + deleteWindows } -body { # Test -bd -padx and -pady frame .f -borderwidth 2 -padx 3 -pady 4 @@ -1125,7 +1125,7 @@ test frame-12.1 {FrameWorldChanged procedure} -setup { deleteWindows } -result {5 6 30 28} test frame-12.2 {FrameWorldChanged procedure} -setup { - deleteWindows + deleteWindows } -body { # Test all -labelanchor positions set font {helvetica 12} @@ -1161,7 +1161,7 @@ test frame-12.2 {FrameWorldChanged procedure} -setup { deleteWindows } -result {1 1 1 1 1 1 1 1 1 1 1 1} test frame-12.3 {FrameWorldChanged procedure} -setup { - deleteWindows + deleteWindows } -body { # Check reaction on font change font create myfont -family courier -size 10 @@ -1199,28 +1199,28 @@ test frame-13.2 {labelframe configuration options} -setup { deleteWindows } -returnCodes error -result {can't modify -class option after widget is created} test frame-13.3 {labelframe configuration options} -setup { - deleteWindows + deleteWindows } -body { labelframe .f -colormap new } -cleanup { deleteWindows } -result {.f} test frame-13.4 {labelframe configuration options} -setup { - deleteWindows + deleteWindows } -body { labelframe .f -visual default } -cleanup { deleteWindows } -result {.f} test frame-13.5 {labelframe configuration options} -setup { - deleteWindows + deleteWindows } -body { labelframe .f -screen bogus } -cleanup { deleteWindows } -returnCodes error -result {unknown option "-screen"} test frame-13.6 {labelframe configuration options} -setup { - deleteWindows + deleteWindows } -body { labelframe .f -container true } -cleanup { @@ -1235,14 +1235,14 @@ test frame-13.7 {labelframe configuration options} -setup { deleteWindows } -result {-container container Container 0 1} test frame-13.8 {labelframe configuration options} -setup { - deleteWindows + deleteWindows } -body { labelframe .f -container bogus } -cleanup { deleteWindows } -returnCodes error -result {expected boolean value but got "bogus"} test frame-13.9 {labelframe configuration options} -setup { - deleteWindows + deleteWindows } -body { labelframe .f .f configure -container 1 @@ -1418,7 +1418,7 @@ destroy .f test frame-14.1 {labelframe labelwidget option} -setup { - deleteWindows + deleteWindows } -body { # Test that label is moved in stacking order label .l -text Mupp -font {helvetica 8} @@ -1433,7 +1433,7 @@ test frame-14.1 {labelframe labelwidget option} -setup { deleteWindows } -result {{.f .l} 54 52} test frame-14.2 {labelframe labelwidget option} -setup { - deleteWindows + deleteWindows } -body { # Test the labelframe's reaction if the label is destroyed label .l -text Aratherlonglabel @@ -1452,7 +1452,7 @@ test frame-14.2 {labelframe labelwidget option} -setup { deleteWindows } -result {.l 12 {} 4} test frame-14.3 {labelframe labelwidget option} -setup { - deleteWindows + deleteWindows } -body { # Test the labelframe's reaction if the label is stolen label .l -text Aratherlonglabel @@ -1471,7 +1471,7 @@ test frame-14.3 {labelframe labelwidget option} -setup { deleteWindows } -result {.l 12 {} 4} test frame-14.4 {labelframe labelwidget option} -setup { - deleteWindows + deleteWindows } -body { # Test the label's reaction if the labelframe is destroyed label .l -text Mupp @@ -1485,7 +1485,7 @@ test frame-14.4 {labelframe labelwidget option} -setup { deleteWindows } -result {labelframe {}} test frame-14.5 {labelframe labelwidget option} -setup { - deleteWindows + deleteWindows } -body { # Test that the labelframe reacts on changes in label label .l -text Aratherlonglabel @@ -1508,7 +1508,7 @@ test frame-14.5 {labelframe labelwidget option} -setup { deleteWindows } -result {12 12 1 12 1} test frame-14.6 {labelframe labelwidget option} -setup { - deleteWindows + deleteWindows } -body { # Destroying a labelframe with a child label caused a crash # when not handling mapping of the label correctly. -- cgit v0.12 From 0191d3ec9578b2eb8fe9dda810cd3d41be852b12 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 19:19:31 +0000 Subject: Replace 'update idletasks' by 'update' in frame-3.10. This was added in [cb5da4af7b] for no stated reason. --- tests/frame.test | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index 0a79844..0336c55 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -673,19 +673,10 @@ test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 - if {[tk windowingsystem] eq "aqua"} { - update idletasks - } else { - update - } + update option add *x.use [winfo id .t] toplevel .x -width 140 -height 300 -bg green - if {[tk windowingsystem] eq "aqua"} { - update idletasks - } else { - tkwait visibility .x - update - } + update list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] -- cgit v0.12 From 64216399f7b8a6bc91856d98c0ffe9a620c2f113 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 19:22:21 +0000 Subject: Remove all 'idletasks' from updates in frame.test. The test should run just fine with a plain 'update'. --- tests/frame.test | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index 0336c55..c449588 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -658,12 +658,6 @@ test frame-3.9 {TkCreateFrame procedure, -use option} -constraints { [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] } -cleanup { -# This call to update idletasks was added to prevent a crash that was -# observed on OSX 10.12 (Sierra) only. Any change, such as using the -# Development version to make debugging symbols available, adding a print -# statement, or calling update idletasks here, would make the test pass -# with no segfault. - update idletasks deleteWindows } -result {0 0 140 300} test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { @@ -1032,7 +1026,7 @@ test frame-9.1 {MapFrame procedure} -setup { toplevel .t -width 100 -height 400 wm geometry .t +0+0 set result [winfo ismapped .t] - update idletasks + update lappend result [winfo ismapped .t] } -cleanup { deleteWindows @@ -1057,7 +1051,7 @@ test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup { frame .t2.f -width 50 -height 50 bind .t2.f {destroy .t} pack .t2.f -side top - update idletasks + update winfo exists .t } -cleanup { deleteWindows -- cgit v0.12 From 74e46dcc73df6d1c041cc9ac4776a25e477fbde4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 20:07:31 +0000 Subject: Stabilize frame-12.3 and textImage-4.2 by making use of <>. These tests sporadically fail at GitHub Actions in branch unstable_tests on macOS with clang (mem, --enable-aqua). When they fail, font-47.2 and font-47.3 also fail. --- tests/frame.test | 3 +++ tests/textImage.test | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/frame.test b/tests/frame.test index c449588..a089606 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -1154,9 +1154,12 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { place .f -x 0 -y 0 -width 40 -height 40 pack [frame .f.f] -fill both -expand 1 update + bind .f <> { set fontwait 1 } set h1 [font metrics myfont -linespace] set y1 [winfo y .f.f] + set fontwait 0 font configure myfont -size 20 + vwait fontwait update set h2 [font metrics myfont -linespace] set y2 [winfo y .f.f] diff --git a/tests/textImage.test b/tests/textImage.test index 5ceecf1..7833e98 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -387,12 +387,15 @@ test textImage-4.2 {alignment checking - baseline} -setup { .t image create end -image small -align baseline .t insert end test update + bind .t <> { set fontwait 1 } # Sizes larger than 25 can be too big and lead to a negative 'norm', # at least on Windows XP with certain settings. foreach size {10 15 20 25} { + set fontwait 0 font configure test_font2 -size $size array set Metrics [font metrics test_font2] - update ; .t sync + vwait fontwait + update foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 -- cgit v0.12 From ed1dff0d5d48627a73d3ccd2ae56cd5199dea685 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 20:10:30 +0000 Subject: In font-47.2, make use of the offset defined instead of using the hardcoded value. --- tests/font.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/font.test b/tests/font.test index 24816e3..bb6a250 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2440,8 +2440,8 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { lassign [$w bbox $text] x0 y0 x1 y1 set offset 5 set coord [lmap expr { - $x0-5 $y0-5 $x1+5 $y0-5 - $x1+5 $y1+5 $x0-5 $y1+5 + $x0-$offset $y0-$offset $x1+$offset $y0-$offset + $x1+$offset $y1+$offset $x0-$offset $y1+$offset } {expr $expr}] if {[catch {$w coord $circ $coord} err]} { puts Error:$err -- cgit v0.12 From 4e9bf9b552c1a8cd7812835265603677e6d9cbf6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 20:40:34 +0000 Subject: Stabilize font-47.2 and font-47.3 by making use of <> instead of waiting for some amount of time (race condition). Same approach as for frame-12.3 and textImage-4.2 (see [2be47c9f]). --- tests/font.test | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tests/font.test b/tests/font.test index bb6a250..1905884 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2425,7 +2425,7 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { 15 [expr {15 + $theight}] \ -width 1 -joinstyle round -smooth true -fill {} -outline blue] pack $c -fill both -expand 1 -side top - tkwait visibility $c + update # Lamda test functions set circle_text {{w user_data text circ} { @@ -2440,33 +2440,35 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { lassign [$w bbox $text] x0 y0 x1 y1 set offset 5 set coord [lmap expr { - $x0-$offset $y0-$offset $x1+$offset $y0-$offset - $x1+$offset $y1+$offset $x0-$offset $y1+$offset + $x0-$offset $y0-$offset $x1+$offset $y0-$offset + $x1+$offset $y1+$offset $x0-$offset $y1+$offset } {expr $expr}] if {[catch {$w coord $circ $coord} err]} { puts Error:$err } + after idle {set fontwait 1} }} - set waitfor {{tag {time 333}} {after $time incr ::wait4; vwait ::wait4}} set enclosed {{can id} {$can find enclosed {*}[$can bbox $id]}} set results {} apply $circle_text $c FontChanged $textid $circid + update bind $c <> [list apply $circle_text %W %d $textid $circid] - apply $waitfor 1 # Begin test: set results {} lappend results [apply $enclosed $c $circid] + set fontwait 0 font configure MyFont -size 26 - apply $waitfor 2 + vwait fontwait lappend results [apply $enclosed $c $circid] + set fontwait 0 font configure MyFont -size 9 - apply $waitfor 3 + vwait fontwait lappend results [apply $enclosed $c $circid] - apply $waitfor 4 + set fontwait 0 font configure MyFont -size 12 - apply $waitfor 5 + vwait fontwait lappend results [apply $enclosed $c $circid] } -cleanup { destroy $c @@ -2508,11 +2510,7 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { set size [font metrics [$w cget -font] -linespace] set img [apply ${make-img} $size] $w configure -image $img - }} - - set waitfor {{tag {time 500}} { - after $time incr ::wait4 - vwait ::wait4 + after idle {set fontwait 1} }} set check {{w} { @@ -2529,19 +2527,22 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { set img [apply ${make-img} $size] set l [label .t.l -compound left -image $img -text $text -font MyFont] pack $l -side top -fill both -expand 1 + update bind $l <> [list apply $testWorldChanged %W %d] set ::results {} - apply $waitfor 0 apply $check $l + set fontwait 0 font configure MyFont -size 26 - apply $waitfor 1 + vwait fontwait apply $check $l + set fontwait 0 font configure MyFont -size 9 - apply $waitfor 2 + vwait fontwait apply $check $l + set fontwait 0 font configure MyFont -size 13 - apply $waitfor 3 + vwait fontwait apply $check $l set results } -cleanup { -- cgit v0.12 From a844958be0708d4911ee71748307d1537bf4cc1a Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 3 Oct 2022 20:56:06 +0000 Subject: Fix typo in comments. --- generic/tkFont.c | 2 +- generic/tkGrab.c | 2 +- win/tkWinWm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkFont.c b/generic/tkFont.c index 71008bc..8138c34 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -908,7 +908,7 @@ RecomputeWidgets( * * This could be done recursively or iteratively. The recursive version is * easier to implement and understand, and typically, windows with a -font - * option will be leaf nodes in the widget heirarchy (buttons, labels, + * option will be leaf nodes in the widget hierarchy (buttons, labels, * etc.), so the recursion depth will be shallow. * * However, the additional overhead of the recursive calls may become a diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 787a2e2..2232ba5 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -26,7 +26,7 @@ * grab state information: the current grab window, the current restrict * window, and whether the mouse is captured. * - * The current grab window specifies the point in the Tk window heirarchy + * The current grab window specifies the point in the Tk window hierarchy * above which pointer events will not be reported. Any window within the * subtree below the grab window will continue to receive events as normal. * Events outside of the grab tree will be reported to the grab window. diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 80bdc75..f27a965 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -7978,7 +7978,7 @@ WmProc( winPtr = GetTopLevel(hwnd); if (winPtr && (TkGrabState(winPtr) == TK_GRAB_EXCLUDED)) { /* - * This window is outside the grab heirarchy, so don't let any of + * This window is outside the grab hierarchy, so don't let any of * the normal non-client processing occur. Note that this * implementation is not strictly correct because the grab might * change between now and when the event would have been processed -- cgit v0.12 From d0131d9e4f795c894bf7dd464cdb101cd7ed1553 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 4 Oct 2022 20:19:58 +0000 Subject: Test with TESTFLAGS='-verbose bepst' on macOS, in order to discover which test hangs sometimes in font.test --- .github/workflows/mac-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index cf19261..c7a9fca 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -41,7 +41,7 @@ jobs: } - name: Run Tests run: | - make test | tee out.txt + make test TESTFLAGS="-verbose bepst" | tee out.txt nmatches=$( grep -c "Failed 0" out.txt ) if [ $nmatches -lt 4 ] then @@ -138,7 +138,7 @@ jobs: echo Xvfb not used, this is a --enable-aqua build } fi - ( runXvfb :0; make test-classic; exit $? ) | tee out-classic.txt || { + ( runXvfb :0; make test-classic TESTFLAGS="-verbose bepst"; exit $? ) | tee out-classic.txt || { echo "::error::Failure during Test (classic)" exit 1 } -- cgit v0.12 From 2f9f759f85d34b988d5959b61331d408eb7d8b09 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 4 Oct 2022 20:36:36 +0000 Subject: Try to let font-47.2 and font-47.3 not stay stuck. --- tests/font.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/font.test b/tests/font.test index 1905884..72dc97e 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2446,6 +2446,7 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { if {[catch {$w coord $circ $coord} err]} { puts Error:$err } + update after idle {set fontwait 1} }} set enclosed {{can id} {$can find enclosed {*}[$can bbox $id]}} @@ -2510,6 +2511,7 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { set size [font metrics [$w cget -font] -linespace] set img [apply ${make-img} $size] $w configure -image $img + update after idle {set fontwait 1} }} -- cgit v0.12 From f8d1893342d2a5e98b2036996170e28bc4e89d07 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 4 Oct 2022 20:52:17 +0000 Subject: Revert [71264368], that made frame-3.10 fail 7 times in 10 tries, on macOS aqua and macOS clang (no, --enable-aqua). --- tests/frame.test | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index a089606..ab09ca6 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -667,10 +667,19 @@ test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 - update + if {[tk windowingsystem] eq "aqua"} { + update idletasks + } else { + update + } option add *x.use [winfo id .t] toplevel .x -width 140 -height 300 -bg green - update + if {[tk windowingsystem] eq "aqua"} { + update idletasks + } else { + tkwait visibility .x + update + } list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] -- cgit v0.12 From 32459d05e14c82d80bac534dbca7498ce925686b Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 6 Oct 2022 20:19:09 +0000 Subject: Add a small delay in font-47.2 and font-47.3 because they could still stay stuck. --- tests/font.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/font.test b/tests/font.test index 72dc97e..3c1b45b 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2447,7 +2447,7 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { puts Error:$err } update - after idle {set fontwait 1} + after idle {after 200 {set fontwait 1}} }} set enclosed {{can id} {$can find enclosed {*}[$can bbox $id]}} @@ -2512,7 +2512,7 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { set img [apply ${make-img} $size] $w configure -image $img update - after idle {set fontwait 1} + after idle {after 200 {set fontwait 1}} }} set check {{w} { -- cgit v0.12 From 875d51254cfa6f6287e578dc3553702bd676c7df Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 7 Oct 2022 20:28:02 +0000 Subject: Keep the small delay in font-47.2 and font-47.3 but remove the after idle. --- tests/font.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/font.test b/tests/font.test index 3c1b45b..1e57d83 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2447,7 +2447,7 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { puts Error:$err } update - after idle {after 200 {set fontwait 1}} + after 200 {set fontwait 1} }} set enclosed {{can id} {$can find enclosed {*}[$can bbox $id]}} @@ -2512,7 +2512,7 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { set img [apply ${make-img} $size] $w configure -image $img update - after idle {after 200 {set fontwait 1}} + after 200 {set fontwait 1} }} set check {{w} { -- cgit v0.12 From 8d0741b00e2a18e0ea6ef654e30c6681e8941ca4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Oct 2022 12:05:40 +0000 Subject: Instrument TheWorldHasChanged() to see whether font-47.2 failure is due to abortion before RecomputeWidgets() is called. --- generic/tkFont.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tkFont.c b/generic/tkFont.c index 8138c34..0c016ca 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -884,6 +884,7 @@ TheWorldHasChanged( */ if (TkpWillDrawWidget(NULL)) { + printf("TheWorldHasChanged, TkpWillDrawWidget returns true --> don't RecomputeWidgets\n");fflush(stdout); return; } -- cgit v0.12 From 9220902d1363e9a5cef7a48ed465562da9cec296 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Oct 2022 12:49:50 +0000 Subject: Try a different approach in font-47.2 and font-47.3. Instead of waiting (which sometimes shuffles the results list on both macOS and Linux), try calling 'update'. --- tests/font.test | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/tests/font.test b/tests/font.test index 1e57d83..25a1ea1 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2446,8 +2446,6 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { if {[catch {$w coord $circ $coord} err]} { puts Error:$err } - update - after 200 {set fontwait 1} }} set enclosed {{can id} {$can find enclosed {*}[$can bbox $id]}} @@ -2459,17 +2457,14 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { # Begin test: set results {} lappend results [apply $enclosed $c $circid] - set fontwait 0 font configure MyFont -size 26 - vwait fontwait + update lappend results [apply $enclosed $c $circid] - set fontwait 0 font configure MyFont -size 9 - vwait fontwait + update lappend results [apply $enclosed $c $circid] - set fontwait 0 font configure MyFont -size 12 - vwait fontwait + update lappend results [apply $enclosed $c $circid] } -cleanup { destroy $c @@ -2511,8 +2506,6 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { set size [font metrics [$w cget -font] -linespace] set img [apply ${make-img} $size] $w configure -image $img - update - after 200 {set fontwait 1} }} set check {{w} { @@ -2534,17 +2527,14 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { set ::results {} apply $check $l - set fontwait 0 font configure MyFont -size 26 - vwait fontwait + update apply $check $l - set fontwait 0 font configure MyFont -size 9 - vwait fontwait + update apply $check $l - set fontwait 0 font configure MyFont -size 13 - vwait fontwait + update apply $check $l set results } -cleanup { -- cgit v0.12 From 32c598481ec950f2ad3a2c40decb445dfab1d377 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Oct 2022 17:13:26 +0000 Subject: Avoid possible hangs in frame-12.3 and textImage-4.2. Hangs were (rarely) observed with frame-12.3 on macOS.. --- tests/frame.test | 2 +- tests/textImage.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index ab09ca6..026913f 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -1168,7 +1168,7 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { set y1 [winfo y .f.f] set fontwait 0 font configure myfont -size 20 - vwait fontwait + if {!$fontwait} {vwait fontwait} update set h2 [font metrics myfont -linespace] set y2 [winfo y .f.f] diff --git a/tests/textImage.test b/tests/textImage.test index 7833e98..4301878 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -394,7 +394,7 @@ test textImage-4.2 {alignment checking - baseline} -setup { set fontwait 0 font configure test_font2 -size $size array set Metrics [font metrics test_font2] - vwait fontwait + if {!$fontwait} {vwait fontwait} update foreach {x y w h} [.t bbox small] {} set norm [expr { -- cgit v0.12 From e5b27e507a6a88dd5b39a947f84bb92cba435ea5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Oct 2022 19:18:23 +0000 Subject: Backout [f8742cd6]. This printf didn't trigger. --- generic/tkFont.c | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tkFont.c b/generic/tkFont.c index 0c016ca..8138c34 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -884,7 +884,6 @@ TheWorldHasChanged( */ if (TkpWillDrawWidget(NULL)) { - printf("TheWorldHasChanged, TkpWillDrawWidget returns true --> don't RecomputeWidgets\n");fflush(stdout); return; } -- cgit v0.12 From 47f7fb6c77d90563bc78b453ef2bd2243533d6fe Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Oct 2022 21:11:35 +0000 Subject: Experiment. See whether this fixes the sporadic unixEmbed test failures with signature 'bad window path name' when tests run 'winfo id xxx'. --- generic/tkCmds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/generic/tkCmds.c b/generic/tkCmds.c index c5f0a50..6211463 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -1348,9 +1348,7 @@ Tk_WinfoObjCmd( Tcl_WrongNumArgs(interp, 2, objv, "window"); return TCL_ERROR; } - string = Tcl_GetString(objv[2]); - tkwin = Tk_NameToWindow(interp, string, tkwin); - if (tkwin == NULL) { + if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin) != TCL_OK) { return TCL_ERROR; } } -- cgit v0.12 From f9add0382b81ab22bc84bd20b0103981c6fe680c Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 10 Oct 2022 19:21:08 +0000 Subject: Backout previout commit [34a6cef5] since unixEmbed-10.2 and unixEmbed-11.2 can still fail (repectively on 'winfo geometry' and 'winfo id'). --- generic/tkCmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 6211463..c5f0a50 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -1348,7 +1348,9 @@ Tk_WinfoObjCmd( Tcl_WrongNumArgs(interp, 2, objv, "window"); return TCL_ERROR; } - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin) != TCL_OK) { + string = Tcl_GetString(objv[2]); + tkwin = Tk_NameToWindow(interp, string, tkwin); + if (tkwin == NULL) { return TCL_ERROR; } } -- cgit v0.12 From efa6b631819aebdd05628a35e79bbb658ebe3ed5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 10 Oct 2022 19:24:28 +0000 Subject: Further try to avoid possible hangs in frame-12.3 and textImage-4.2. Hangs were (rarely) observed with frame-12.3 on macOS. --- tests/frame.test | 2 +- tests/textImage.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/frame.test b/tests/frame.test index 026913f..132df17 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -1168,8 +1168,8 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { set y1 [winfo y .f.f] set fontwait 0 font configure myfont -size 20 - if {!$fontwait} {vwait fontwait} update + if {!$fontwait} {vwait fontwait} set h2 [font metrics myfont -linespace] set y2 [winfo y .f.f] expr {($h2 - $h1) - ($y2 - $y1)} diff --git a/tests/textImage.test b/tests/textImage.test index 4301878..8586b6c 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -394,8 +394,8 @@ test textImage-4.2 {alignment checking - baseline} -setup { set fontwait 0 font configure test_font2 -size $size array set Metrics [font metrics test_font2] - if {!$fontwait} {vwait fontwait} update + if {!$fontwait} {vwait fontwait} foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 -- cgit v0.12 From 5a64bed54b2c6a377a74941a0c09c4324c9cf878 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 10 Oct 2022 19:43:48 +0000 Subject: Test Marc's finding about failures in unixEmbed.test due to interactions between successive tests. --- tests/constraints.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 23b48d1..d1eeb8b 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -122,6 +122,7 @@ namespace eval tk { namespace export deleteWindows proc deleteWindows {} { eval destroy [winfo children .] + update } namespace export fixfocus -- cgit v0.12 From 39b4a070af5ed074efb46594218092ddfa024ea7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 11 Oct 2022 20:13:03 +0000 Subject: Further try to avoid possible hangs in frame-12.3, textImage-4.2, font-47.2 and font-47.3. Hangs were (still) observed with frame-12.3 on macOS. This commit is based on an analysis of what is happening (from the events point of view) when changing a font configuration such as its size. --- tests/font.test | 10 ++++++++-- tests/frame.test | 6 ++---- tests/textImage.test | 6 ++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/font.test b/tests/font.test index 25a1ea1..f292b58 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2458,12 +2458,15 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { set results {} lappend results [apply $enclosed $c $circid] font configure MyFont -size 26 - update + update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events lappend results [apply $enclosed $c $circid] font configure MyFont -size 9 + update idletasks update lappend results [apply $enclosed $c $circid] font configure MyFont -size 12 + update idletasks update lappend results [apply $enclosed $c $circid] } -cleanup { @@ -2528,12 +2531,15 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { apply $check $l font configure MyFont -size 26 - update + update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events apply $check $l font configure MyFont -size 9 + update idletasks update apply $check $l font configure MyFont -size 13 + update idletasks update apply $check $l set results diff --git a/tests/frame.test b/tests/frame.test index 132df17..1f91104 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -1163,13 +1163,11 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { place .f -x 0 -y 0 -width 40 -height 40 pack [frame .f.f] -fill both -expand 1 update - bind .f <> { set fontwait 1 } set h1 [font metrics myfont -linespace] set y1 [winfo y .f.f] - set fontwait 0 font configure myfont -size 20 - update - if {!$fontwait} {vwait fontwait} + update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events set h2 [font metrics myfont -linespace] set y2 [winfo y .f.f] expr {($h2 - $h1) - ($y2 - $y1)} diff --git a/tests/textImage.test b/tests/textImage.test index 8586b6c..40f0829 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -387,15 +387,13 @@ test textImage-4.2 {alignment checking - baseline} -setup { .t image create end -image small -align baseline .t insert end test update - bind .t <> { set fontwait 1 } # Sizes larger than 25 can be too big and lead to a negative 'norm', # at least on Windows XP with certain settings. foreach size {10 15 20 25} { - set fontwait 0 font configure test_font2 -size $size array set Metrics [font metrics test_font2] - update - if {!$fontwait} {vwait fontwait} + update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 -- cgit v0.12 From 6b43f692eede00fd7e610f738dea47d98e263068 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 13 Oct 2022 03:52:23 +0000 Subject: The latter commit made font-47.2, font-47.3, frame612.3 and textImage-4.2 fail again (but not always). Try more updates. --- tests/font.test | 8 ++++---- tests/frame.test | 4 ++-- tests/textImage.test | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/font.test b/tests/font.test index f292b58..b3e286a 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2458,8 +2458,8 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { set results {} lappend results [apply $enclosed $c $circid] font configure MyFont -size 26 - update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events - update ; # services the queued "TkWorldChanged" events + update ; # services the "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events lappend results [apply $enclosed $c $circid] font configure MyFont -size 9 update idletasks @@ -2531,8 +2531,8 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body { apply $check $l font configure MyFont -size 26 - update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events - update ; # services the queued "TkWorldChanged" events + update ; # services the "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events apply $check $l font configure MyFont -size 9 update idletasks diff --git a/tests/frame.test b/tests/frame.test index 1f91104..f3fb1e1 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -1166,8 +1166,8 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { set h1 [font metrics myfont -linespace] set y1 [winfo y .f.f] font configure myfont -size 20 - update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events - update ; # services the queued "TkWorldChanged" events + update ; # services the "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events set h2 [font metrics myfont -linespace] set y2 [winfo y .f.f] expr {($h2 - $h1) - ($y2 - $y1)} diff --git a/tests/textImage.test b/tests/textImage.test index 40f0829..0d82bb4 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -392,8 +392,8 @@ test textImage-4.2 {alignment checking - baseline} -setup { foreach size {10 15 20 25} { font configure test_font2 -size $size array set Metrics [font metrics test_font2] - update idletasks ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events - update ; # services the queued "TkWorldChanged" events + update ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events foreach {x y w h} [.t bbox small] {} set norm [expr { (([image height large] - $Metrics(-linespace))/2 -- cgit v0.12 From c94c4a7cce4f66efca6a1fc0c3c79d98e501cb9a Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 13 Oct 2022 03:56:05 +0000 Subject: Revert [14f82014], i.e. remove TESTFLAGS='-verbose bepst' on macOS. --- .github/workflows/mac-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index c7a9fca..cf19261 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -41,7 +41,7 @@ jobs: } - name: Run Tests run: | - make test TESTFLAGS="-verbose bepst" | tee out.txt + make test | tee out.txt nmatches=$( grep -c "Failed 0" out.txt ) if [ $nmatches -lt 4 ] then @@ -138,7 +138,7 @@ jobs: echo Xvfb not used, this is a --enable-aqua build } fi - ( runXvfb :0; make test-classic TESTFLAGS="-verbose bepst"; exit $? ) | tee out-classic.txt || { + ( runXvfb :0; make test-classic; exit $? ) | tee out-classic.txt || { echo "::error::Failure during Test (classic)" exit 1 } -- cgit v0.12 From 94e9c08adc449da1a427da799da4cc929e01973b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 15 Oct 2022 15:48:41 +0000 Subject: Increase the timeout value in canvImg-4.2 since it was seen triggering once on macOS in more than 30 runs of the test suite. --- tests/canvImg.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/canvImg.test b/tests/canvImg.test index 4c71a9a..e2e9e58 100644 --- a/tests/canvImg.test +++ b/tests/canvImg.test @@ -166,7 +166,7 @@ test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup { update set x {} set y {} - set timer [after 300 {lappend y "timed out"}] + set timer [after 500 {lappend y "timed out"}] .c itemconfigure i1 -image foo2 update idletasks update -- cgit v0.12 From 1b183e45908ee881f08e7418e1f2dca355112a4b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 15 Oct 2022 15:53:57 +0000 Subject: Document why there is an 'update' in proc deleteWindows. --- tests/constraints.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index d1eeb8b..e1e0dd4 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -122,6 +122,10 @@ namespace eval tk { namespace export deleteWindows proc deleteWindows {} { eval destroy [winfo children .] + # This update is needed to avoid intermittent failures on macOS in unixEmbed.test + # Reason for the failures is unclear but could have to do with window ids being deleted + # after the destroy command returns. The detailed mechanism of such delayed deletions + # is not understood, but it appears that this update prevents the test failures. update } -- cgit v0.12 From 2c8c0c4a4fdbeb373c95d3e00581373040e1f83d Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 15 Oct 2022 20:37:17 +0000 Subject: Fix comment in tkMacOSXTest.c because it did not follow the successive changes in how we signal testing events to tkProcessMouseEvent. --- macosx/tkMacOSXTest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index 164576a..3f178c3 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -174,7 +174,7 @@ TkTestLogDisplay( * location. It injects NSEvents into the NSApplication event queue, as * opposed to adding events to the Tcl queue as event generate would do. * One application is for testing the grab command. These events have - * their unused context property set to 1 as a signal indicating that they + * their timestamp property set to 0 as a signal indicating that they * should not be ignored by [NSApp tkProcessMouseEvent]. * * Results: @@ -229,7 +229,7 @@ PressButtonObjCmd( loc.y = ScreenHeight - y; /* - * We set the timestamp to 0 as a signal to processMouseEvent. + * We set the timestamp to 0 as a signal to tkProcessMouseEvent. */ CGWarpMouseCursorPosition(pt); -- cgit v0.12