dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Assistance Request


From: Dave Korn
Subject: RE: Assistance Request
Date: Mon, 11 Feb 2008 22:07:57 -0000

On 11 February 2008 21:29, Joel Sherrill wrote:

> We use versioned target names.  Do I have to list them all in
> the following section?
> 
> =====================================
> # This is a list of toolchains that are supported on this board.
> set_board_info target_install {powerpc-rtems4.9}
> =====================================

  I don't know for a fact, I've never tried it, but I'd guess...

runtest.exp:        if { [lsearch -exact $target_install $target_alias] >= 0 }

.. you need to explicitly enumerate them.  (There might be a good argument for
making that --glob or even --regex).

> What about arguments to the simulator?  As you can see in
> the example, we use this to invoke powerpc-rtems-run:
> 
> RUN -f DEVICE_TREE_FILE EXECUTABLE
> 
> where DEVICE_TREE_FILE has the device configuration.  How does
> that get passed through?  Where should the DEVICE_TREE_FILE
> go?

  I handle that - and this works for me because, like your case, the
EXECUTABLE is last on the commandline - by doing the equivalent of

set_board_info sim "RUN -f DEVICE_TREE_FILE"

and the EXECUTABLE gets appended by proc sim_spawn.  (Looking at that, it
seems there is some way of specifying the sim and the flags separately by 

set_board_info sim "RUN"
set_board_info sim,flags "-f DEVICE_TREE_FILE"

but I have never tried it myself.)

>>> + an extra object file to link with.
>>> 
>> 
>> set_board_info ldflags
>> 
> Do I custom compile testrun.c myself? Or is that automatic?
> For sure we need the main() wrapper for no return code.  I
> can have the application start at main() so that isn't an issue.

  There's a thing called

set_board_info needs_status_wrapper 1

which I forget how it works, but that's one way to make it work.  In my case,
I've added a flag to my simulator so that the sim itself returns the exit
status of the executable (and detects if the simulated app hits abort() or
exit() at the same time, I have no runtime library to speak of).
 
> I assume I have to manually compile an rtems specific support
> file before the tests are run right?

  If the needs_status_wrapper stuff doesn't do what you want, I think - again,
untested - you could probably invoke the compiler from your baseboard script.
Don't really know about this one though.

 
>>> + target CFLAGS and LDFLAGS
>>> 
>> 
>> set_board_info cflags
>> set_board_info ldflags
>> 
>> 
> As you can hopefully see now, we need to generically do this:
> 
> -B ${prefix}/${target}/BSP/ -specs bsp_specs -qrtems CPU_CFLAGS
> 
> where each board has its own CPU_CFLAGS. For psim, it would be
> something like this when fully expanded:
> 
> -B/home/joel/rtems-4.9-work/bsp-install//powerpc-rtems4.9/psim/lib/ \
>     -specs bsp_specs -qrtems -mcpu=603e  -Dppc603e
> 
> I hate to hard-code a path or target since it is versioned.  Are there
> DejaGNU variables I can use?

  I pass external environment vars into the script by using

make check RUNTESTFLAGS=" ...  MY_SCRIPT_VAR=${MY_SCRIPT_VAR} ... "

then I can use the value of MY_SCRIPT_VAR in the various set_board_info flags;
that should do for getting things like prefix and target into your flags.

>>   So, how far are you at?  Have you got a baseboard script written yet? 
>> Have you read the "Extending DejaGnu" chapter of the manual, specifically
>> the "Adding a new board" section? 
>> 
>> 
> I'm hacking on that.  But am not comfortable with this and
> still don't know how to invoke runtest properly. :)

  I always use

make -k check RUNTESTFLAGS="... whatever ..."

and don't bother trying to invoke it directly.  (Can replace "check" by
"check-gcc" if you want to skip the mangler tests etc.)

  Haven't tried your testcase yet; I'll look at it if we can't get this going
in just a few rounds of email exchanges.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....





reply via email to

[Prev in Thread] Current Thread [Next in Thread]