Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#1912 incomplete compatibility in tcltest 2.1 (TIP 101)

obsolete: 8.4a5
Don Porter
Don Porter

The changes approved in TIP 101 included a promise
of compatibility. The actual implementation falls just
slightly short of the mark.

It is intended that when any tcltest operation that
could be influenced by configuration from the
command line occurs, then tcltest is auto-configured
from ::argv as it always has been. Users wishing
to use [tcltest::configure] to control their own
configuration need to call it after
[package require tcltest 2.1] and before any other
tcltest commands (all of them are likely to auto-configure,
because they all change behavior based on the
-debug option) or reading any tcltest::* variables

This in fact does work, but it is set up with variable
traces, which leads to its own problems. Because
traces are disabled while traces are serviced, the
auto-configuration can't completely work when
triggered by access to variables that need further
traces to complete their configuration.

More specifically, if the first tcltest operation following
a [package require tcltest] is a read of any of
the following variables:


either directly, or through the corresponding


then the auto-configuration from the command
line arguments will not be correct for the
corresponding option, if it appears on the
command line, because these options need
enabled trace to complete their configuration.

For example, if a test file starts:

package require tcltest
puts "writing to [tcltest::outputFile]"

then the "-outfile" option will not work
properly on that test file.

The fix is to insert some other operation
before that one; or to require 2.1, and
call configure yourself.

package require tcltest
set dummy [tcltest::debug]
puts "writing to [tcltest::outputFile]"


package require tcltest 2.1
eval tcltest::configure $argv
puts "writing to [tcltest::outputFile"

Given these workarounds, and the expected
rarity of these very particular test file
configurations, this bug will not be fixed.
Most files will have compatibility serviced
fine, but these rare cases will just have to
deal with it.


  • Don Porter
    Don Porter

    • summary: incomplete compatibility in tcltest 2.1 --> incomplete compatibility in tcltest 2.1 (TIP 101)
    • status: open --> closed-wont-fix