bugDejaGnu - Bugs: bug #11834, local_exec returns no output if...

 
 

bug #11834: local_exec returns no output if using inp/outp

Submitter:  None
Submitted:  Thu 03 Feb 2005 07:26:56 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  bje
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 31 Aug 2013 01:00:29 AM UTC, comment #3: 

No feedback after two years.

Ben Elliston <bje>
Group administrator
Fri 11 Mar 2011 10:38:25 AM UTC, comment #2: 

Sorry, I trimmed my last comment a bit too much.  For completeness, this is the output I get:

NOTE: status :0 {10}:
NOTE: comp_output :10:

Ben Elliston <bje>
Group administrator
Fri 11 Mar 2011 10:33:18 AM UTC, comment #1: 

I wrote the following test case based on your report:

set status [local_exec "wc -l" "/etc/hosts" "" 3]
note "status :$status:"
set comp_output [lindex $status 1]
note "comp_output :$comp_output:"

which produces:

Running foo.exp ...
NOTE: status :0 {10}:

So, it appears fixed in version 1.5. Can you please confirm?

Ben Elliston <bje>
Group administrator
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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bje (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-31 bje Open/ClosedOpen Closed
    2013-08-31 bje StatusReady For Test Works For Me
    2011-03-11 bje Assigned toNone bje
    2011-03-11 bje StatusWorks For Me Ready For Test
    2011-03-11 bje StatusIn Progress Works For Me
    2011-03-10 bje StatusNone In Progress
    2005-02-03 jaq Carbon-Copy- Added jaq

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code