source: rtems-testing/gcc/test_driver @ fa26552

4.11
Last change on this file since fa26552 was 5fd483f, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 28, 2011 at 3:59:18 PM

2011-01-28 Joel Sherrill <joel.sherrill@…>

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