Tk Source Code

View Ticket
Login
Ticket UUID: 3554052
Title: Test textTag-15.1 fails
Type: Bug Version: obsolete: 8.5.12
Submitter: fvogel Created on: 2012-08-03 16:09:26
Subsystem: 69. Events Assigned To: fvogel
Priority: 6 Severity: Minor
Status: Closed Last Modified: 2015-04-28 18:49:34
Resolution: Fixed Closed By: fvogel
    Closed on: 2015-04-28 18:49:34
Description:
In core-8-5-branch, on Windows Vista, test textTag-15.1 fails when it is executed after test text-36.* in a combined run.


To demonstrate the issue, run the entire test suite of Tk, or just the tests such that "-file text*.test", or more minimally:

set MYTCL="<path>\tcltk-fossil\tcl-fossil"
set MYTK="<path>\tcltk-fossil\tk-fossil"
cd %MYTK%\win
nmake -f makefile.vc test OPTS=symbols TCLDIR=%MYTCL% TESTFLAGS="-file text{,Tag}.test"

This will run the tests from files text.test and testTag.test in turn, and only those from these files, in the local fossil repositories.

Then you get the failure:

==== textTag-15.1 TkTextBindProc FAILED
==== Contents of test case:

    bind .t <ButtonRelease> {lappend x up}
    .t tag bind x <ButtonRelease> {lappend x x-up}
    .t tag bind y <ButtonRelease> {lappend x y-up}
    set x {}
    .t tag add x 2.0 2.4
    .t tag add y 4.3
    event gen .t <Button> -x $x1 -y $y1
    event gen .t <Motion> -x $x1 -y $y1
    event gen .t <ButtonRelease> -x $x1 -y $y1
    event gen .t <Button> -x $x1 -y $y1
    event gen .t <Motion> -x $x2 -y $y2
    event gen .t <ButtonRelease> -x $x2 -y $y2
    event gen .t <Button> -x $x2 -y $y2
    event gen .t <Motion> -x $x3 -y $y3
    event gen .t <ButtonRelease> -x $x3 -y $y3
    bind .t <ButtonRelease> {}
    set x

---- Result was:
up up up
---- Result should have been (exact matching):
x-up up up y-up up
==== textTag-15.1 FAILED


Running textTag.test alone does not trigger the problem: textTag-15.1 passes in this case.

The problem shows up however when text.test is run before textTag.test.

Trimming down:
  - not running just text-36.1 (nor 36-2 nor 36-3) makes textTag-15.1 pass
  - the issue is then in the interaction between those tests when run all in a row

Further narrowing down, I've come up with the following script to demonstrate the problem:


pack [text .t1]
event generate .t1 <1>
destroy .t1

pack [text .t -width 20 -height 10]
.t insert 1.0 "Line 1"
update

set c [.t bbox 1.1]
set x1 [expr [lindex $c 0] + [lindex $c 2]/2]
set y1 [expr [lindex $c 1] + [lindex $c 3]/2]
bind .t <ButtonRelease> {lappend x up}
.t tag bind x <ButtonRelease> {lappend x x-up}
set x {}
.t tag add x 1.0 1.4
event generate .t <Button> -x $x1 -y $y1
event generate .t <Motion> -x $x1 -y $y1
event generate .t <ButtonRelease> -x $x1 -y $y1

set x

#  x-up up   is expected,  however most of the time (but not always) simply
#  up        is output, which is wrong

destroy .t


This script seems to be minimal.

To show the issue, launch wish, and paste the script in in at once. The output should be:

x-up up

but is is:

up

most of the time, although not always!


The trimmed test case above demonstrates the problem at least in 8.5 from core-8-5-branch, or core-8-4-branch, or 8.5.9 precompiled binaries from Activestate.
I could not reproduce the problem in trunk so far.


Clueless...
User Comments: fvogel added on 2015-04-28 18:49:34:
In trunk, reverting [b28d8aaa7c] makes the problem appear in trunk. Definitely the solution is backporting of [b28d8aaa7c] to core-8-5-branch, which I did.
Closing this bug.

fvogel added on 2015-04-26 18:35:25:
This was definitely due to interactions between different tests of the test suite. It was fixed in trunk 5 years ago.

Fix proposed in branch bug-3554052fff, simply backporting [b28d8aaa7c] to core-8-5-branch.

fvogel added on 2015-04-25 15:13:05:
This is probably the key:

http://core.tcl.tk/tk/info/b28d8aaa7c9bfe05

Will investigate further and confirm.

fvogelnew1 added on 2012-08-23 03:17:38:
Reproduced on Ubuntu 12.04 LTS Precise Pangolin, with Tcl/Tk 8.5.11.