|
2019-04-09
| ||
| 19:56 | • Closed ticket [940ce8f958]: TIP 527 breaks two namespace tests plus 6 other ... artifact: 5d4ab0c7d3 user: sebres | |
| 19:37 | closes [940ce8f958] - tests/cmdMZ.test: avoid import timerate to global NS in tests (e. g. using tcl... check-in: 242fe24b35 user: sebres tags: core-8-5-branch | |
| 19:07 | • Ticket [940ce8f958] TIP 527 breaks two namespace tests status still Open wit... artifact: c7a420104c user: dgp | |
| 19:01 | • New ticket [940ce8f958]. artifact: 0ff997bd68 user: dgp | |
TIP 527 breaks two namespace tests
Closed / Fixed940ce8f95872ed87c7c86c05f8215b1182b853caCreated 8 years agoUpdated 8 years ago
Descriptionplain2019-04-09 19:01:35
$ make test TESTFLAGS='-singleproc 1 -file "cmdMZ.test namespace\*.test"'
...
namespace-old.test
==== namespace-old-9.5 empty import list in "namespace import" command FAILED
==== Contents of test case:
lsort [namespace import]
---- Result was:
bytestring cleanupTests configure customMatch debug errorChannel errorFile getMatchingFiles interpreter limitConstraints loadFile loadScript loadTestedCommands mainThread makeDirectory makeFile match matchDirectories matchFiles normalizeMsg normalizePath outputChannel outputFile preserveCore removeDirectory removeFile restoreState runAllTests saveState singleProcess skip skipDirectories skipFiles temporaryDirectory test testConstraint testsDirectory threadReap timerate verbose viewFile workingDirectory
---- Result should have been (exact matching):
bytestring cleanupTests configure customMatch debug errorChannel errorFile getMatchingFiles interpreter limitConstraints loadFile loadScript loadTestedCommands mainThread makeDirectory makeFile match matchDirectories matchFiles normalizeMsg normalizePath outputChannel outputFile preserveCore removeDirectory removeFile restoreState runAllTests saveState singleProcess skip skipDirectories skipFiles temporaryDirectory test testConstraint testsDirectory threadReap verbose viewFile workingDirectory
==== namespace-old-9.5 FAILED
namespace.test
==== namespace-28.1 NamespaceImportCmd, no args FAILED
==== Contents of test case:
catch {namespace delete {*}[namespace children :: test_ns_*]}
lsort [namespace import]
---- Result was:
bytestring cleanupTests configure customMatch debug errorChannel errorFile getMatchingFiles interpreter limitConstraints loadFile loadScript loadTestedCommands mainThread makeDirectory makeFile match matchDirectories matchFiles normalizeMsg normalizePath outputChannel outputFile preserveCore removeDirectory removeFile restoreState runAllTests saveState singleProcess skip skipDirectories skipFiles temporaryDirectory test testConstraint testsDirectory threadReap timerate verbose viewFile workingDirectory
---- Result should have been (exact matching):
bytestring cleanupTests configure customMatch debug errorChannel errorFile getMatchingFiles interpreter limitConstraints loadFile loadScript loadTestedCommands mainThread makeDirectory makeFile match matchDirectories matchFiles normalizeMsg normalizePath outputChannel outputFile preserveCore removeDirectory removeFile restoreState runAllTests saveState singleProcess skip skipDirectories skipFiles temporaryDirectory test testConstraint testsDirectory threadReap verbose viewFile workingDirectory
==== namespace-28.1 FAILED
Referenced by1
242fe24b35closes [940ce8f958] - tests/cmdMZ.test: avoid import timerate to global NS in tests (e. g. using tcltest -singleproc 1 -file 'cmdMZ* namespace*') check-in2019-04-09 19:37:55
dgpplain2019-04-09 19:07:23
The trouble is that tests in cmdMZ.test pull [timerate] into the global namespace, which then upsets the tests in namespace*.test that find it there unexpectedly. We want the test suite to be robust to the "-singleproc 1" option. This could be solved multiple ways. I think I prefer revising [timerate] to not pop into :: without an explicit [namespace import] by the programmer, which would be added to cmdMZ.test and balanced with a [namespace forget]. Better yet, an approach that would not pull [timerate] into :: at all, but would pull it into the namespace tcl::test::cmdMZ where are the testing is done in the file cmdMZ.test. Would not even need [namespace forget]. The import would disappear when the testing namespace gets deleted.
sebreswiki2019-04-09 19:56:35
Fixed in [242fe24b35] now, and sorry for that... Thus closed.
BTW, I didn't thought "-singleproc 1" works properly at all across several tests, because I always saw a lot of errors like - can't set "a": variable is array, etc (if used this option).
I believe we need several clean-up's and/or inclusions of tests in namespaces etc in order to make it completely safe for usage of "-singleproc 1".
Log in (anonymous is fine) to add a comment.