source: rtems-testing/gcc/test_driver @ a34504d

4.11
Last change on this file since a34504d was a34504d, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 20, 2010 at 12:43:02 AM

2010-07-19 Joel Sherrill <joel.sherrill@…>

  • test_driver: Add -T option to getopt string.
  • Property mode set to 100755
File size: 5.6 KB
Line 
1#! /bin/sh
2#
3#  Test Driver
4#
5#  $Id$
6#
7
8vfile=`dirname $0`/../VERSIONS
9if [ ! -r ${vfile} ] ; then
10  echo VERSIONS file not found
11  exit 1
12fi
13
14source ${vfile}
15
16if [ ! -d ${BASEDIR} ] ; then
17  echo Have you set the BASEDIR in VERSIONS correctly?
18  exit 1
19fi
20
21BASEDIR=`pwd`
22
23for d in ${AUTOCONF} ${AUTOMAKE} ${BINUTILSDIR} \
24    ${GDBDIR} ${NEWLIBDIR} ${GCCDIR}
25do
26  if [ ! -d ${d} ] ; then
27    echo "Cannot locate ${d} -- aborting"
28    exit 1
29  fi
30done
31
32toggle()
33{
34  case $1 in
35    no)  echo "yes" ;;
36    yes) echo "no" ;;
37    *)   fatal "Unknown value to toggle ($1)" ;;
38  esac
39}
40
41usage()
42{
43cat <<EOF
44do_one [options] CPU ..  CPU
45  -A - enable clean, native, and update
46  -a - build Ada (default=yes)
47  -c - clean install point (also installs auto tools)
48  -m - mail results to lists (default=yes)
49  -n - build native
50  -T - run tests (default=yes)
51  -u - update GNU source if version from CVS/SVN
52  -U - update RTEMS source if version from CVS/SVN (will bootstrap)
53  -v - verbose
54EOF
55}
56
57doCleanInstallPoint="no"
58doUpdateTools="no"
59doUpdateRTEMS="no"
60doNative="no"
61verbose="no"
62doAda="yes"
63doMail="yes"
64doTests="yes"
65
66while getopts AacmnuTUv OPT
67do
68  case "$OPT" in
69    A) doCleanInstallPoint=`toggle ${doCleanInstallPoint}`
70       doNative=`toggle ${doNative}`
71       doUpdateTools=`toggle ${doUpdateTools}`
72       doUpdateRTEMS=`toggle ${doUpdateRTEMS}`
73       ;;
74    a) doAda=`toggle ${doAda}` ;;
75    c) doCleanInstallPoint=`toggle ${doCleanInstallPoint}` ;;
76    m) doMail=`toggle ${doMail}` ;;
77    n) doNative=`toggle ${doNative}` ;;
78    T) doTests=`toggle ${doTests}` ;;
79    u) doUpdateTools=`toggle ${doUpdateTools}` ;;
80    U) doUpdateRTEMS=`toggle ${doUpdateRTEMS}` ;;
81    v) verbose=`toggle ${verbose}` ;;
82    *) usage; exit 1;
83  esac
84done
85
86shiftcount=`expr $OPTIND - 1`
87shift $shiftcount
88
89args=$*
90
91CPUs=""
92for cpu in ${args}
93do
94  if [ ${cpu} = "native" ] ; then
95    doNative="yes"
96  else
97    CPUs="${CPUs} ${cpu}"
98  fi
99done
100
101
102if [ ${verbose} = "yes" ] ; then
103  echo "Clean Install Point: " ${doCleanInstallPoint}
104  echo "Install Autotools:   " ${doCleanInstallPoint}
105  echo "Install Native:      " ${doNative}
106  echo "Update Tool Source:  " ${doUpdateTools}
107  echo "Update RTEMS:        " ${doUpdateRTEMS}
108  echo "Build Ada            " ${doAda}
109  echo "Email Results:       " ${doMail}
110  echo "Run Tests:           " ${doTests}
111  if [ "X${CPUs}" = "X" ] ; then
112    echo "CPUs to Build:       " ALL
113  else
114    echo "CPUs to Build:       " ${CPUs}
115  fi
116fi
117
118test ${doMail}  = "no"   && mailArg="-M"
119test ${doTests} = "yes" && testArg="-T"
120test ${doAda}   = "yes" && adaArg="-a"
121
122start=`date`
123echo Started at: ${start}
124
125# HELPER - Update RTEMS
126update_rtems()
127{
128  cd ${RTEMSDIR}
129  if [ -d CVS ] ; then
130    cvs up -Pd 2>&1 | grep -v ^cvs
131    ./bootstrap -c
132    ./bootstrap
133  fi
134}
135
136# HELPER - Update GCC
137update_gcc()
138{
139  cd ${GCCDIR}
140  if [ -d .svn ] ; then
141    grep "svn+ssh" .svn/entries >/dev/null
142    if [ $? -eq 0 ] ; then
143      echo "Skipping gcc update -- ssh keyed check out"
144    else
145      echo "Updating gcc -- anonymous check out"
146      ./contrib/gcc_update
147      if [ $? -ne 0 ] ; then
148        echo "Update of GCC Failed."
149        exit 1
150      fi
151   fi
152  fi
153  return 0
154}
155
156# HELPER - Remove all the installed previous builds
157clean_up()
158{
159  rm -rf ${INSTALL}/* ${BSP_INSTALL}/*
160}
161
162install_auto()
163{
164  for auto in ${AUTOCONF} ${AUTOMAKE}
165  do
166    cd ${auto}
167    make distclean
168    ./configure --prefix=${INSTALL}
169    make all install
170  done
171}
172
173# This handles GNU tools from CVS
174update_others()
175{
176  for d in ${BINUTILSDIR} ${GDBDIR} ${NEWLIBDIR}
177  do
178   
179    cd ${d}
180    if [ -d .svn ] ; then
181      echo "I do not update SVN for ${d}"
182      exit 1
183   fi
184   if [ -d CVS ] ; then
185     cvs up -P 2>&1 | grep -v ^cvs
186   fi
187  done
188}
189
190do_cpus()
191{
192  bsp=
193
194  exitStatus=0
195  for cpu in $*
196  do
197    case $cpu in
198      arm)     bsp=edb7312      ;;
199      avr)     bsp=avrtest      ;;
200      bfin)    bsp=eZKit533     ;;
201      h8300)   bsp=h8sim        ;;
202      i386)    bsp=pc386        ;;
203      lm32)    bsp=lm32_evr     ;;
204      m32c)    bsp=m32csim      ;;
205      m32r)    bsp=m32rsim      ;;
206      m68k)    bsp=uC5282       ;;
207      mips)    bsp=jmr3904      ;;
208      powerpc) bsp=psim         ;;
209      sh)      bsp=simsh1       ;;
210      sparc)   bsp=sis          ;;
211      *)
212        echo "Unknown CPU ${cpu}"
213        exit 1
214        ;;
215    esac
216
217    doOne=${SCRIPTDIR}/gcc/do_one
218    time sh -x ${doOne} -v -b -D -1 -d -r ${adaArg} ${mailArg} ${testArg} \
219        ${cpu} ${bsp} >${BASEDIR}/${bsp}.log 2>&1
220    echo $?
221  done
222
223  stopped=`date`
224  echo Started at: ${start}
225  echo Stopped at: ${stopped}
226}
227
228update_gcc
229
230if [ ${doCleanInstallPoint} = "yes" ] ; then
231  # Clean the install point
232  clean_up
233fi
234
235# Update gcc and install autotools in parallel
236  if [ ${doCleanInstallPoint} = "yes" ] ; then
237    install_auto
238  fi
239  if [ ${doUpdateTools} = "yes" ] ; then
240    update_gcc
241    update_others
242  fi
243wait
244
245# Do any remaining prep work in parallel
246  if [ ${doUpdateRTEMS} = "yes" ] ; then
247    update_rtems
248  fi
249wait
250
251if [ ${doNative} = "yes" ]; then
252  # Build the native compiler as a baseline to build the others
253  time sh -x ${SCRIPTDIR}/gcc/do_one -n >${BASEDIR}/native.log 2>&1
254fi
255
256# Now cycle over all these CPUs
257if [ $? -eq 0 ] ; then
258  if [ $# -eq 0 ] ; then
259    # Requires Skyeye install
260    do_cpus arm
261
262    # no simulator -- waiting for Skyeye
263    do_cpus bfin m68k
264
265    # Simulators included in gdb
266    do_cpus h8300 lm32 m32c m32r mips powerpc sh sparc
267
268    # Requires qemu installation
269    do_cpus i386 m68k
270
271
272    # port insufficient to run gcc tests
273    do_cpus avr
274  else
275    for cpu in ${CPUs}
276    do
277      do_cpus ${cpu}
278    done
279  fi
280 
281fi
282
283stopped=`date`
284echo Started at: ${start}
285echo Stopped at: ${stopped}
Note: See TracBrowser for help on using the repository browser.