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

4.104.114.95
Last change on this file since e0487ed 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: 3.0 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       gen_device_tree ${tname}-node1${variant}${ext}  >${TREE_FILE}_1
66       gen_device_tree ${tname}-node2${variant}${ext}  >${TREE_FILE}_2
67
68       runone ${tname}-node1${variant}${ext} \
69        ${max_run_time} ${TREE_FILE}_1 | \
70         sed -e 's/^M//' -e '/^$/d' > ${logfile1} &
71       runone ${tname}-node2${variant}${ext} \
72         ${max_run_time} ${TREE_FILE}_2 | \
73         sed -e 's/^M//' -e '/^$/d' > ${logfile2} &
74       wait
75
76       #rm -f ${TREE_FILE}_1 ${TREE_FILE}_2
77   fi
78
79   if [ $TEST_TYPE = "single" ]
80   then
81     logfile=$logdir/${tname}_1
82     infofile=$logfile.info
83
84     rm -f ${logfile}.tmp*
85
86     date=`date`
87     echo "Starting $tname at $date"
88
89     # Spin off the simulator in the background
90     #   -c could be used to set an instruction limit
91     gen_device_tree ${tfile}  >${TREE_FILE}
92     runone ${tfile} ${max_run_time} | \
93       sed -e 's/^M//' -e '/^$/d' > ${logfile}
94
95     rm -f ${TREE_FILE}
96   fi
97
98   # Create the info files
99   for cpu in $cpus
100   do
101   {
102       echo "$date"
103       echo "Test run on: `uname -n`"
104       echo "Host Information:"
105       echo `uname -a`
106       echo
107
108       cat ${logdir}/${tname}_${cpu}
109
110       if [ "$ran_too_long" = "yes" ]
111       then
112         echo "Test did NOT finish normally; killed after $max_run_time seconds"
113       fi
114
115       echo
116       date;
117   } > ${logdir}/${tname}_${cpu}.info
118   done
119
120   if [ "$cpus" = "1" ]
121   then
122        mv ${infofile} $logdir/${tname}.info
123        mv ${logfile}  $logdir/${tname}
124   fi
125
126done
127
128echo "Tests completed at " `date`
129test_exit 0
130
131# Local Variables: ***
132# mode:ksh ***
133# End: ***
134
Note: See TracBrowser for help on using the repository browser.