[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting environment variables when doing remove execution
From: |
Tobias Burnus |
Subject: |
Re: Setting environment variables when doing remove execution |
Date: |
Tue, 26 Nov 2019 15:12:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
Hi Jacob,
On 11/26/19 12:53 AM, Jacob Bachmeyer wrote:
As an interim measure, could you simply prepend the needed environment
variables to the remote command and/or use env(1)?
I thought of doing this – but while for compiling it is simple, doing so
for run time is more difficult.
In GCC, one just sets the output_file to the executable (proc
gcc-dg-test-1 in gcc/testsuite/lib/gcc-dg.exp, which is a call back for
dg.exp). And the actual handling is in DejaGNU itself:
proc dg-test of lib/dg.exp has:
…
if { [lindex ${dg-do-what} 0] eq "run" } {
if {![file exists $output_file]} {
unresolved "$name compilation failed to produce executable"
} else {
set status -1
set result [${tool}_load $output_file]
which first checks whether "output_file" exists before it runs it
(${tool}_load).
If I look at 'proc remote_load' of lib/remote.exp this also does quite some
file handling
(copying them, running objcopy etc.) before it finally calls:
set sumout [remote_exec build $sum_program $prog]
This does not make injecting "env a=val b=val $prog" that simple.
Cheers,
Tobias