Tk Library Source Code

View Ticket
Login
Ticket UUID: 1272721
Title: failed tests
Type: Bug Version: None
Submitter: dgp Created on: 2005-08-25 16:40:51
Subsystem: units Assigned To: techentin
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2005-08-26 02:24:45
Resolution: Fixed Closed By: techentin
    Closed on: 2005-08-25 19:24:45
Description:
As part of a complete

  tclsh sak.tcl test

run:

==== units-9.1 non-SI calorie FAILED
==== Contents of test case:

    ::units::convert 1.0calorie joule

---- Result was:
4.1867999999999999
---- Result should have been (exact matching):
4.1868
==== units-9.1 FAILED


==== units-10.1 leading zero is not octal FAILED
==== Contents of test case:

    ::units::convert 09mm meter

---- Result was:
0.0090000000000000011
---- Result should have been (exact matching):
0.009
==== units-10.1 FAILED

No failures from

  tclsh sak.tcl test units

so there's a tcl_precision leak
between test files that should be
fixed, and the test should be
robust against it anyway.
User Comments: techentin added on 2005-08-26 02:24:45:
Logged In: YES 
user_id=43494

Corrected bigfloat.test and optimize.test in modules/math.

andreas_kupries added on 2005-08-26 00:19:14:
Logged In: YES 
user_id=75003

runAllTests - Likely for historic reasons.

Note however also the insertion of special test contraints,
and helper commands. IIRC these are not done by runAllTests.
I would say that this should be reported in a new entry, and
investigated separately from these failures.

I agree that the math tests should take care to restore the
tcl_precision.

dgp added on 2005-08-26 00:18:06:
Logged In: YES 
user_id=80530


Even with [runAllTests] these
leakage issues ought to be
addressed to support the
-singleProc 1 configuration.

techentin added on 2005-08-26 00:13:56:
Logged In: YES 
user_id=43494

This can be fixed by setting tcl_precision back to the
default in units.test.  This would work around the side
effect from other unit tests.

Perhaps a different solution would be to have the math
libraries reset tcl_precision to the default after they are
done with it.

But the real root of the problem seems to come from tcllib's
all.tcl, which goes to great length to run all the module
tests in a slave interpreter.  Since all interpreters share
tcl_precision, it leaks between modules.  It is also leaking
::env, and this scheme may also have trouble with tests
checking -output and -errorOutput.  This might be causing
the errors in docstrip.test.

So why doesn't tcllib just execute tcltest::runAllTests,
like everybody else?

andreas_kupries added on 2005-08-26 00:04:34:
Logged In: YES 
user_id=75003

Grepping ...

bigfloat, calculus, lingalg, optimize are the math packages
whose testsuites change tcl_precision.

andreas_kupries added on 2005-08-25 23:53:49:
Logged In: YES 
user_id=75003

The math tests are a likely source of changes to
tcl_precision. We can check this by

    tclsh sak.tcl test math units

Confirmed. The above is enough to cause the unit tests to fail.
We should bring "sarnold75" and "arjenmarkus" into this.