Set environment variable on remote target

Jie Zhang jie.zhang@analog.com
Wed Jul 16 17:23:00 GMT 2008


libmudflap tests set a environment MUDFLAP_OPTIONS=-viol-segv before 
testing such that violations are promoted to SIGSEGV signals in testing. 
Otherwise, the exit value would be 0 even the test has violations. 
libmudflap testsuite depends on the exit value of tests to decide if the 
test PASS or FAIL. Setting MUDFLAP_OPTIONS is done in DejaGNU by

   setenv MUDFLAP_OPTIONS "-viol-segv"

which works fine on native testing. But when doing remote cross testing, 
setenv does not help. I cannot find existing mechanism in DejaGNU. So I 
want to use a global array like remote_env. If remote cross testing, add 
the environment variable in this array. Then set the environment 
variables according to the array when remote execute test case. I wrote 
a draft patch show what I means, which is attached. In mudflap 
testsuite, replace each setenv with

         if { ![is_remote target] } {
             setenv MUDFLAP_OPTIONS "-viol-segv"
         } else {
             remote_setenv MUDFLAP_OPTIONS "-viol-segv"
         }

Is it the right way to do this, or is there existing method I can use 
but I missed?


Thanks,

Jie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dejagnu-remote-env.diff
Type: text/x-patch
Size: 1573 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20080716/6d909c74/attachment.bin>


More information about the Gcc mailing list