source: rtems/c/src/lib/libbsp/powerpc/psim/tools/runtest-top.in @ 5a6d25fc

4.104.11
Last change on this file since 5a6d25fc was 5a6d25fc, checked in by Till Straumann <strauman@…>, on Sep 11, 2009 at 10:42:00 PM

2009-09-11 Till Straumann <Till.Straumann@…>

  • psim-top.in, psim-bottom: Added support for options -d (print device tree and exit), -h (usage info) and -n (enable NIC support).
  • psim-gdb-bottom: Added support for options -s (force sysv IPC), -h (usage info) and -n (enable NIC support). Allow user to override GDB variable from environment.
  • psim-shared: cat NIC properties into device file if the user had specified '-n'.
  • runtest-top.in: removed unsupported options -o, -d from usage info.
  • Property mode set to 100755
File size: 1.7 KB
Line 
1#!@KSH@ -p
2#
3# Run rtems tests on the powerpc simulator
4# This program generates a simulator script to run each test
5# Typically the test is then run, although it can be generated
6# and left as a file using -s
7#
8#  COPYRIGHT (c) 1989-2008.
9#  On-Line Applications Research Corporation (OAR).
10#
11#  The license and distribution terms for this file may be
12#  found in found in the file LICENSE in this distribution or at
13#  http://www.rtems.com/license/LICENSE.
14#
15#  $Id$
16#
17
18# progname=`basename $0`
19progname=${0##*/}        # fast basename hack for ksh, bash
20if [ X${RUN} = X ] ; then
21  RUN=@target_alias@-run
22fi
23
24USAGE=\
25"usage: $progname [ -opts ] test [ test ... ]
26        -v          -- verbose
27        -l logdir   -- specify log directory (default is 'logdir')
28
29  Specify test as 'test' or 'test.exe'.
30  All multiprocessing tests *must* be specified simply as 'mp01', etc.
31"
32
33# export everything
34set -a
35
36#   log an error to stderr
37prerr()
38{
39    echo "$*" >&2
40}
41
42fatal() {
43    [ "$1" ] && prerr $*
44    prerr "$USAGE"
45    exit 1
46}
47
48warn() {
49    [ "$1" ] && prerr $*
50}
51
52# print args, 1 per line
53ml_echo()
54{
55    for l
56    do
57       echo "$l"
58    done
59}
60
61# run at normal and signalled exit
62test_exit()
63{
64    exit_code=$1
65
66    rm -f ${logfile}.tmp*
67    [ "$sim_pid" ] && kill -9 $sim_pid
68
69    exit $exit_code
70}
71
72#
73# process the options
74#
75# defaults for getopt vars
76#
77# max_run_time is defaulted to 5 minutes
78#
79
80verbose=""
81logdir=log
82update_on_tick="no"
83max_run_time=$((5 * 60))
84instruction_limit=1000000000
85
86while getopts vl: OPT
87do
88    case "$OPT" in
89        v) verbose="yes";;
90        l) logdir="$OPTARG";;
91        *) fatal;;
92    esac
93done
94
95let $((shiftcount = $OPTIND - 1))
96shift $shiftcount
97
98args=$*
99
100#
101#  Check some parameters
102#
103
104# XXX nothing to check so far
Note: See TracBrowser for help on using the repository browser.