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

4.104.114.95
Last change on this file since 7eb312d5 was 001b4162, checked in by Joel Sherrill <joel.sherrill@…>, on 09/03/08 at 18:37:51

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

  • Makefile.am, configure.ac: Rework psim scripts to share code for creating device trees and actually running the tests. Overhaul the device tree generated to always include a block of Flash and a Real-Time Clock. When running MP tests enable the shared memory and semaphore devices.
  • psim-bottom, psim-gdb-bottom, psim-gdb-top.in, psim-shared, psim-top.in, runtest-bottom, runtest-top.in: New files.
  • psim, psim-gdb, runtest: Removed.
  • 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
20RUN=@target_alias@-run
21
22USAGE=\
23"usage: $progname [ -opts ] test [ test ... ]
24        -o options  -- specify options to be passed to simulator
25        -v          -- verbose
26        -d          -- generate device tree file (as 'test'.device) and exit
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.