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:  None Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  Ben Elliston <bje>
Open/Closed:  Closed

Add a New Comment(Rich 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.




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

Attach Files:

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)

    Do you think this task is very important?
    If so, you can 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 UTC bje Open/ClosedOpen => Closed
    Sat 31 Aug 2013 01:00:00 AM UTC bje StatusReady For Test => Works For Me
    Fri 11 Mar 2011 11:37:41 AM UTC bje Assigned toNone => bje
    Fri 11 Mar 2011 11:36:33 AM UTC bje StatusWorks For Me => Ready For Test
    Fri 11 Mar 2011 10:33:18 AM UTC bje StatusIn Progress => Works For Me
    Thu 10 Mar 2011 11:04:40 PM UTC bje StatusNone => In Progress
    Thu 03 Feb 2005 07:35:07 AM UTC jaq Carbon-Copy- => Added jaq

    Back to the top

    Powered by Savane 3.3