Tcl Source Code

View Ticket
Login
2026-10-28
13:43 • Closed ticket [572400ffff]: constraint exprs defeat limitConstraints plus 5 ... artifact: c62fffa3e3 user: jan.nijtmans
2026-10-22
11:44
Many tcltest improvements, [773924ffff], [811659ffff], [572400ffff], [8413e79232] and [1528500fff] check-in: e44f1d0e87 user: jan.nijtmans tags: core-9-0-branch
08:35 • Pending ticket [572400ffff]: constraint exprs defeat limitConstraints plus 4... artifact: 25c06a6a74 user: jan.nijtmans
08:25
Many tcltest improvements, [773924ffff], [9f4feaaaa1], [811659ffff], [572400ffff], [8413e79232] and ... check-in: 891b7e7921 user: jan.nijtmans tags: trunk, main
2026-10-20
18:30 • Ticket [572400ffff] constraint exprs defeat limitConstraints status still Op... artifact: 8ed9bc39cc user: dgp
18:20 • Ticket [572400ffff]: 6 changes artifact: 0e9159b0a0 user: dgp
14:26 • Ticket [572400ffff]: 4 changes artifact: 110cc03791 user: serhiy.storchaka
14:22
Fix [572400ffff]: with -limitconstraints, a constraint expression is satisfied only if it is true an... closed check-in: 241d536f30 user: serhiy.storchaka tags: tcltest-limitconstraints-expr
2002-06-22
04:05 • New ticket [572400ffff] constraint exprs defeat limitConstraints. artifact: 080bef8fa7 user: dgp

Ticket UUID: 572400
Title: constraint exprs defeat limitConstraints
Type: Bug Created on: 2002-06-22 04:05:02
Submitter: dgp Assigned to: dgp
Subsystem: 34. tcltest Package Severity: Minor
Priority: 5 Medium Last modified: 2026-10-28 13:43:31
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-10-28 13:43:31
Version: 8.6.18, 9.0.5, 9.1.0
Description:
The [test] command honors constraint "expressions" so that,
for example, one could constrain a test with "!unix" to run
only on platforms that are not unix.  (Don't do that!  Use
notUnix instead).

However, the [limitConstraints] feature is implemented so
that it only works if all constraints are simple lists of
constraint keywords.  (It may be even worse -- it could
be that only simple constraints can be managed by
the [limitConstraints] feature).

For example, testing Tcl with the options
    -constraints knownBug -limitConstraints 1
to try to test only known bugs, the test
tcltest-5.5 is still run because its constraint is
    !singleProc
User Comments:
serhiy.storchaka added on 2026-10-20 14:26:05:

Still the case on main, 9.0 and 8.6: -limitconstraints forces the unselected constraints to 0, so expressions like !foo or $::tcl_version > 0 become true. With -constraints knownBug -limitconstraints 1 the whole test suite runs 76 tests.

Proposed fix in branch [241d536f30|tcltest-limitconstraints-expr] (stacked on the other tcltest fixes): in that mode an expression constraint must also name one of the selected constraints. The knownBug run then has 29 tests. New test tcltest-5.2b.


dgp added on 2026-10-20 18:20:29:
Thanks for the work on this.  I'm putting it on my list of
fixes to examine.

Just a comment that for me a desired long-range fix for
these issues would be to eliminate support for constraint
expressions.  They've always been short of working well,
reliably and robustly, and the gain from trying to offer
it is just not compelling.

At least the ideal tcltest, version 3 in my head does not have it.

dgp added on 2026-10-20 18:30:18:
One consequence of constraint expression support
is you cannot have an expression with a name
anything like

  this-should-only-run-in-this-situation

because tcltest insists on thinking that is
a constraint subtraction.  Just not good.

jan.nijtmans added on 2026-10-22 08:35:38:
Fixed in [891b7e7921|trunk], not backported yet to 9.0 and 8.6

I don't think I would want constraints with minus-signs in it. What I see now is using camelCase, like thisShouldOnlyRunInThisSituation

jan.nijtmans added on 2026-10-28 13:43:31:

Now also backported to core-9-0-branch and core-8-6-branch

Closing. Many thanks!