source: rtems/c/src/lib/libbsp/powerpc/psim/tools/runtest-bottom @ 001b4162

4.104.114.9
Last change on this file since 001b4162 was 001b4162, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 3, 2008 at 6:37:51 PM

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: 2.7 KB
Line 
1#
2# Run the tests
3#
4
5tests="$args"
6if [ ! "$tests" ]
7then
8     set -- `echo *.exe`
9     tests="$*"
10fi
11
12[ -d $logdir ] ||
13  mkdir $logdir || fatal "could not create log directory ($logdir)"
14
15# where the tmp files go
16trap "test_exit" 1 2 3 13 14 15
17
18for tfile in $tests
19do
20   echo $tfile | grep "exe$" >/dev/null
21   if [ $? -eq 0 ] ; then
22     ext=.exe
23   else
24     ext=.ralf
25   fi
26   tname=`basename $tfile ${ext}`
27   cpus="1"
28   TEST_TYPE="single"
29
30   case $tname in
31       # size is no longer interactive.
32       capture* | monitor* | termios* | fileio* | pppd*)
33            warn "Skipping $tname; it is interactive"
34            continue
35            ;;
36       *-node2*)
37           warn "Skipping $tname; 'runtest' runs both nodes when for *-node1"
38           continue;;
39       *-node1*)
40           warn "Running both nodes associated with $tname"
41           variant=`echo $tname | sed 's/.*-node[12]//' | sed 's/\.exe//'`
42           tname=`echo $tname | sed 's/-node.*//'`
43           TEST_TYPE="mp"
44           ;;
45       minimum*|stackchk*|*fatal*|termio*)
46           continue           ;;
47   esac
48
49   if [ $TEST_TYPE = "mp" ]
50   then
51       cpus="1 2"
52
53       logfile1=$logdir/${tname}_1${variant}
54       logfile2=$logdir/${tname}_2${variant}
55       infofile1=$logfile1.info
56       infofile2=$logfile2.info
57
58       rm -f ${logfile1} ${logfile2}
59
60       date=`date`
61       echo "Starting $tname at $date"
62
63       # XXX -c ${instruction_limit}
64
65       runone ${tname}-node1${variant}.${ext} ${max_run_time} | \
66         sed -e 's/^M//' -e '/^$/d' > ${logfile1} &
67       runone ${tname}-node2${variant}.${ext} ${max_run_time} | \
68         sed -e 's/^M//' -e '/^$/d' > ${logfile2} &
69       wait
70
71   fi
72
73   if [ $TEST_TYPE = "single" ]
74   then
75     logfile=$logdir/${tname}_1
76     infofile=$logfile.info
77
78     rm -f ${logfile}.tmp*
79
80     date=`date`
81     echo "Starting $tname at $date"
82
83     # Spin off the simulator in the background
84     #   -c could be used to set an instruction limit
85     runone ${tfile} ${max_run_time} | \
86       sed -e 's/^M//' -e '/^$/d' > ${logfile}
87   fi
88
89   # Create the info files
90   for cpu in $cpus
91   do
92   {
93       echo "$date"
94       echo "Test run on: `uname -n`"
95       echo "Host Information:"
96       echo `uname -a`
97       echo
98
99       cat ${logdir}/${tname}_${cpu}
100
101       if [ "$ran_too_long" = "yes" ]
102       then
103         echo "Test did NOT finish normally; killed after $max_run_time seconds"
104       fi
105
106       echo
107       date;
108   } > ${logdir}/${tname}_${cpu}.info
109   done
110
111   if [ "$cpus" = "1" ]
112   then
113        mv ${infofile} $logdir/${tname}.info
114        mv ${logfile}  $logdir/${tname}
115   fi
116
117done
118
119echo "Tests completed at " `date`
120test_exit 0
121
122# Local Variables: ***
123# mode:ksh ***
124# End: ***
125
Note: See TracBrowser for help on using the repository browser.