Attachment "xttests.diff" to
ticket [0d1a98ce9d]
added by
emiliano
2026-05-22 17:33:25.
Index: tests/unixNotfy.test
==================================================================
--- tests/unixNotfy.test
+++ tests/unixNotfy.test
@@ -16,10 +16,11 @@
}
# When run in a Tk shell, these tests hang.
testConstraint noTk [expr {0 != [catch {package present Tk}]}]
testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}]
+testConstraint testeventloop [expr {[info commands testeventloop] ne {}}]
# The next two tests will hang if threads are enabled because the notifier
# will not necessarily wait for ever in this case, so it does not generate
# an error.
test unixNotfy-1.1 {Tcl_DeleteFileHandler} -constraints nonPortable -body {
@@ -89,9 +90,51 @@
catch { close $f1 }
catch { close $f2 }
catch { removeFile foo }
catch { removeFile foo2 }
}
+# Xt event loop integration
+test unixNotify-3.1 {NotifierProc: non-modal normal timer} {unix testeventloop} {
+ update
+ set x 0
+ foreach i [after info] {
+ after cancel $i
+ }
+ after 500 { incr x; testeventloop done }
+ testeventloop wait
+ set x
+} 1
+test unixNotify-3.2 {NotifierProc: non-modal normal timer, rescheduled} {unix testeventloop} {
+ update
+ set x 0
+ foreach i [after info] {
+ after cancel $i
+ }
+ after 500 { incr x; after 100 {incr x; testeventloop done }}
+ testeventloop wait
+ set x
+} 2
+test unixNotify-3.5 {NotifierProc: non-modal idle timer} {unix testeventloop} {
+ update
+ set x 0
+ foreach i [after info] {
+ after cancel $i
+ }
+ after idle { incr x; testeventloop done }
+ testeventloop wait
+ set x
+} 1
+test unixNotify-3.6 {NotifierProc: non-modal idle timer, rescheduled} {unix testeventloop} {
+ update
+ set x 0
+ foreach i [after info] {
+ after cancel $i
+ }
+ after idle { incr x; after idle {incr x; testeventloop done }}
+ testeventloop wait
+ set x
+} 2
+
# cleanup
::tcltest::cleanupTests
return