|
2026-11-20
| ||
| 15:42 | • Closed ticket [7abc1460c0]: tcltest: under Tk, runAllTests exits with status 0 b... artifact: c1dc0b184b user: jan.nijtmans | |
|
2026-11-17
| ||
| 14:06 | • Ticket [2884e645a5] tcltest-29.2 fails status still Open with 3 other change... artifact: 36afc91474 user: serhiy.storchaka | |
| 12:10 | Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors check-in: f1c3430326 user: jan.nijtmans tags: core-8-6-branch | |
| 12:08 | Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors check-in: 6c569928e0 user: jan.nijtmans tags: core-9-0-branch | |
|
2026-11-16
| ||
| 14:44 | Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors check-in: fc10972b81 user: jan.nijtmans tags: trunk, main | |
| 10:27 | • Ticket [7abc1460c0] tcltest: under Tk, runAllTests exits with status 0 before re... artifact: 51b6cc31ee user: serhiy.storchaka | |
| 10:10 | Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors. cleanupTests, ... closed check-in: 87296fe492 user: serhiy.storchaka tags: tcltest-runalltests-exit-status | |
| 09:58 | • Ticket [7abc1460c0] tcltest: under Tk, runAllTests exits with status 0 before re... artifact: f212efc2c3 user: serhiy.storchaka | |
| 09:57 | • New ticket [7abc1460c0]. artifact: 1fc1cb25ab user: serhiy.storchaka | |
tcltest: under Tk, runAllTests exits with status 0 before reporting errors
Closed / Fixed7abc1460c04b46880ae4e950befea5a5b45133d6Created 16 days agoUpdated 12 days ago
Descriptionwiki2026-11-16 09:57:55
Under Tk, cleanupTests exits so that a test file run as the main script (wish foo.test) does not wait in the event loop. But runAllTests also calls cleanupTests 1 after the last test file, and when the all file is the main script, this exits too, with status 0, before runAllTests lists the test files that exited with errors and before it returns its result. So under Tk, if {[tcltest::runAllTests]} {exit 1} never exits with 1, and "Test files exiting with errors" is never printed.
all.tcl:
package require Tk
package require tcltest
tcltest::configure -testdir [file dirname [file normalize [info script]]] {*}$argv
if {[tcltest::runAllTests]} {
exit 1
}
fail.test:
package require tcltest
namespace import tcltest::*
test fail-1.1 {a failing test} -body {expr 1} -result 2
cleanupTests
wish all.tcl prints Failed 1 but exits with status 0, with Tcl 8.6.18 and with the current main, with -singleproc 0 and 1.
This makes the CI of Tk report success when tests fail at startup.
Suggested fix: do not exit in cleanupTests when it is called from runAllTests. At the end of runAllTests, where the exit is needed (under Tk, with the all file as the main script), exit with status 1 if there were failures or test file errors, and 0 otherwise; elsewhere return the result as documented. Scripts which do not check the result keep working, but such runs then end with a non-zero status when tests fail.
Referenced by5
36afc91474Ticket [2884e645a5] tcltest-29.2 fails status still Open with 3 other changes ticket2026-11-17 14:06:20f1c3430326Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors check-in2026-11-17 12:10:376c569928e0Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors check-in2026-11-17 12:08:40fc10972b81Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors check-in2026-11-16 14:44:3087296fe492Fix [7abc1460c0]: under Tk, runAllTests exited with status 0 before reporting errors. cleanupTests, called by runAllTests for the summary, exited when the all file was the main script of Tk, before runAllTests listed the test files that exited with errors and returned its result, so a failing test suite ended with status 0. Now cleanupTests does not exit when called from runAllTests, and runAllTests exits at the same point, after its report, with its result as the exit status. check-in2026-11-16 10:10:49
serhiy.storchakawiki2026-11-16 09:58:21
Tk ticket: ead4782b08, with a workaround in Tk branch ci-test-exit-status.
serhiy.storchakawiki2026-11-16 10:27:54
Proposed fix in branch tcltest-runalltests-exit-status.
jan.nijtmanswiki2026-11-20 15:42:50
Merged to [trunk], core-9-0-branch and core-8-6-branch
Many thanks!
Log in (anonymous is fine) to add a comment.