File: rt.sh

package info (click to toggle)
gpsim 0.22.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,536 kB
  • ctags: 12,443
  • sloc: cpp: 69,959; sh: 8,626; asm: 7,706; ansic: 4,101; lex: 1,125; makefile: 1,094; yacc: 760
file content (56 lines) | stat: -rwxr-xr-x 1,027 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh

# Regression Test Script for invoking specific targets in Makefiles
#
# 

USAGE="Usage: `basename $0` DIRECTORY TARGET"

if [ $# -lt 2 ] ; then
  echo "$USAGE"
  exit 1
fi

# this is the directory where the test will be performed
cd $1

# Create an start up script with the gpsim command
#   load STC
#
# The makefiles invoke gpsim with the command
#
# gpsim -i -c startup.stc -D STC = "actual.stc"
#
# the -D option creates a symbol named STC with the string
# value "actual.stc". The startup.stc file then symbolic
# references the target specific simulation script via
# the defined STC.


STARTUP_STC='startup.stc'

echo "load STC" > $STARTUP_STC
echo "run" >> $STARTUP_STC
echo "quit" >> $STARTUP_STC
echo "" >> $STARTUP_STC

LOGFILE="$2results.log"
touch $LOGFILE

# Run the simulation and save the results
make $2 > $LOGFILE

cat $LOGFILE |\
sed -n -e '/running\.\.\./,$ {
/^ *Message:/ {
s/^ *Message:\(.*\)$/\1/p
q
}
}
$ a\
FAILED
' | grep "PASSED"

if [ $? -ne 0 ] ; then
  echo "!!! FAILED $1/make $2"
fi