source: rtems-testing/gcc/test_driver @ 288a6fb

4.11
Last change on this file since 288a6fb was 288a6fb, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 21, 2010 at 12:41:37 PM

2010-07-21 Vinu Rajashekhar <vinutheraj@…>

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