Overview
| Artifact ID: | f184ba45e44e2342cb64573edfbaeb818378d744 |
|---|---|
| Ticket: | 2f9df4c4faf342320cdc05066ef43bf0f4ca5b59
tcltest - request to move -cleanup script execution until after -output compare |
| User & Date: | anonymous on 2014-06-19 03:32:09 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I've been trying to create a customMatch in tcltest that allows me to specify the output results via the -output switch that uses data generated by the -body portion of the test. So, the -output switch in such a scenario would look something like: -output {$myVariableDefinedIntheBodySection} and the customMatch is equally straightforward with: tcltest::customMatch exactSubst exactSubst proc exactSubst { expected actual } { set expectedSubst "subst {$expected}" set expectedSubst [uplevel 1 $expectedSubst] return [tcltest::CompareStrings $actual $expectedSubst exact] } so, I just make the customMatch perform the required variable substitution in the -output value. To use it I use -match exactSubst as expected. All is well *except* in the -cleanup section of test, I naturally unset the variable myVariableDefinedIntheBodySection. The odd thing is that tclTest::test runs the -cleanup script *before* it performs the -output, -errorOutput comparisons. This, of course, thwarts my attempt to use the variable in the -output switch. This example is a little contrived and in my real case I really want to delete the variable so it doesn't pollute the next test which uses the same variable (in a slightly different way). So, the request is to move the execution of -cleanup until after the output, errorOutput and result comparisons in tcltest::test. It's a bit odd that it's in its current location in the code so that makes me think that it's intentional. So I'm curious to know if it can be done safely. Regardless, love tcltest and been using it for years. Thank you for your efforts. :-) best regards, Mark - foundin changed to: "2.3.6"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "d4456006aa793a9b5e98c8665afe28d8d71968fe"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "34. tcltest Package"
- title changed to:
tcltest - request to move -cleanup script execution until after -output compare
- type changed to: "Support"