Re: tcltest Tk Applications
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: tcltest Tk Applications

From: Erik Leunissen <look@the.footer.invalid>
Date: Mon May 30 2005 - 10:13:45 CEST

Bob Techentin wrote:

> But are there other
> things that are going to sneak up and bite me? Or is this a good
> approach for application testing?
>

I also once used the setup that you describe, using a slave interp. In
such a setup, tests that check stdout and stderr appear not to don't
work; tests that use -output and -errorOuput fail.

I tried to cure this by loading tcltest also into the slave interp, but
to no avail. Appended you find a small script that exercises the failure.

Greetings,

Erik Leunissen
==============

package require tcltest 2.2
namespace import -force tcltest::*
tcltest::configure -verbose {body pass error}

set setupScript {
        interp create slave
        # This did not help:
        # slave eval [list package require tcltest 2.2]
}
set cleanupScript {
        interp delete slave
}

test errorOutput-1.1 {writes to stderr from main interp} -body {
        puts stderr "Do you read stderr (master)?"
} -errorOutput "Do you read stderr (master)?\n" \
                -result ""

test errorOutput-1.2 {writes to stderr from slave interp} -body {
        slave eval [list puts stderr "Do you read stderr (slave)?"]
} -errorOutput "Do you read stderr (slave)?\n" \
                -result "" -setup $setupScript -cleanup $cleanupScript

-- 
   leunissen@       nl | Merge the left part of these two lines into one,
e.          hccnet.   | respecting a character's position in a line.
Received on Thu Sep 29 14:19:38 2005