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

4.104.114.95
Last change on this file since b3bbcdf1 was e0487ed, checked in by Joel Sherrill <joel.sherrill@…>, on 09/05/08 at 14:42:35

2008-09-05 Joel Sherrill <joel.sherrill@…>

  • psim-shared, psim-top.in, runtest-bottom, runtest-top.in: Now running mptests.
  • Property mode set to 100755
File size: 1.8 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        -o options  -- specify options to be passed to simulator
27        -v          -- verbose
28        -d          -- generate device tree file (as 'test'.device) and exit
29        -l logdir   -- specify log directory (default is 'logdir')
30
31  Specify test as 'test' or 'test.exe'.
32  All multiprocessing tests *must* be specified simply as 'mp01', etc.
33"
34
35# export everything
36set -a
37
38#   log an error to stderr
39prerr()
40{
41    echo "$*" >&2
42}
43
44fatal() {
45    [ "$1" ] && prerr $*
46    prerr "$USAGE"
47    exit 1
48}
49
50warn() {
51    [ "$1" ] && prerr $*
52}
53
54# print args, 1 per line
55ml_echo()
56{
57    for l
58    do
59       echo "$l"
60    done
61}
62
63# run at normal and signalled exit
64test_exit()
65{
66    exit_code=$1
67
68    rm -f ${logfile}.tmp*
69    [ "$sim_pid" ] && kill -9 $sim_pid
70
71    exit $exit_code
72}
73
74#
75# process the options
76#
77# defaults for getopt vars
78#
79# max_run_time is defaulted to 5 minutes
80#
81
82verbose=""
83logdir=log
84update_on_tick="no"
85max_run_time=$((5 * 60))
86instruction_limit=1000000000
87
88while getopts vl: OPT
89do
90    case "$OPT" in
91        v) verbose="yes";;
92        l) logdir="$OPTARG";;
93        *) fatal;;
94    esac
95done
96
97let $((shiftcount = $OPTIND - 1))
98shift $shiftcount
99
100args=$*
101
102#
103#  Check some parameters
104#
105
106# XXX nothing to check so far
Note: See TracBrowser for help on using the repository browser.