Thu 03 Feb 2005 07:26:56 AM UTC, original submission:
I have a test function being called using the dg.exp harness that looks like this:
proc filtergen-dg-test { filter do_what extra } {
set status [local_exec "input/filtergen/t/scan" "$filter" "" 3]
verbose "status :$status:"
set comp_output [lindex $status 1]
verbose "comp_output :$comp_output:"
return [list $comp_output]
}
the last lines of local_exec (file remote.exp) look like:
verbose "output is $output"
if { $outp == "" } {
return [list $status $output]
} else {
return [list $status ""]
}
When runtest -v -v -v -v is run, I can see that $output is set correctly, but $status and $comp_output never are.
Further investigation shows that this is because $outp is being set:
if ($inp == "" && $outp = "") {
...
} else {
if ($outp == "") {
set outp "|& cat"
which means that outp will end up never remaining empty if inp is set. The net result is that if you call local_exec and specify a file to stream into stdin, you can't get any output.
I hacked around this locally by removing the if block, returning [list $status $output] regardless, though instead I think it needs a different variable to use to record the state of $outp.
Thanks.
|