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

 
 

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

Submitted by:  None
Submitted on:  Thu 03 Feb 2005 07:26:56 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: Ben Elliston <bje>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

No feedback after two years.

Ben Elliston <bje>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 31 Aug 2013 01:01:17 AM UTCbjeOpen/ClosedOpen=>Closed
    Sat 31 Aug 2013 01:00:00 AM UTCbjeStatusReady For Test=>Works For Me
    Fri 11 Mar 2011 11:37:41 AM UTCbjeAssigned toNone=>bje
    Fri 11 Mar 2011 11:36:33 AM UTCbjeStatusWorks For Me=>Ready For Test
    Fri 11 Mar 2011 10:33:18 AM UTCbjeStatusIn Progress=>Works For Me
    Thu 10 Mar 2011 11:04:40 PM UTCbjeStatusNone=>In Progress
    Thu 03 Feb 2005 07:35:07 AM UTCjaqCarbon-Copy-=>Added jaq

    Back to the top


    Powered by Savane 3.1-cleanup