diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-19 22:41:22 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-19 22:41:22 +0000 |
commit | 79ee6ca447e1b62f4b35e5b9ac13ce1919250202 (patch) | |
tree | e167b678c2ae5803006d97080e6d236153cc5312 /gcc/test_driver | |
parent | 51db39ddd3df56c7c12eafe39a706a578e0d213d (diff) |
2009-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* gcc/Makefile.rtems_gccmain, gcc/do_one, gcc/do_tests, gcc/gcc_status,
gcc/rtems_gcc_main.c, gcc/rundeja, gcc/test_driver: New files.
* Makefile.rtems_gccmain, do_one, do_tests, gcc_status,
rtems_gcc_main.c, rundeja, test_driver: Removed.
Diffstat (limited to 'gcc/test_driver')
-rwxr-xr-x | gcc/test_driver | 190 |
1 files changed, 190 insertions, 0 deletions
diff --git a/gcc/test_driver b/gcc/test_driver new file mode 100755 index 0000000..8438836 --- /dev/null +++ b/gcc/test_driver @@ -0,0 +1,190 @@ +#! /bin/sh +# +# Test Driver +# +# $Id$ +# + +vfile=`dirname $0`/VERSIONS +if [ ! -r ${vfile} ] ; then + echo VERSIONS file not found + exit 1 +fi + +source ${vfile} + +if [ ! -d ${BASEDIR} ] ; then + echo Have you set the BASEDIR in VERSIONS correctly? + exit 1 +fi + +start=`date` +echo Started at: ${start} + +BASEDIR=`pwd` + +for d in ${AUTOCONF} ${AUTOMAKE} ${BINUTILSDIR} \ + ${GDBDIR} ${NEWLIBDIR} ${GCCDIR} +do + if [ ! -d ${d} ] ; then + echo "Cannot locate ${d} -- aborting" + exit 1 + fi +done + +### TODO: Parse arguments to get these +doCleanInstallPoint="yes" +doUpdateTools=yes +doUpdateRTEMS=yes +doNative=yes + +# HELPER - Update RTEMS +update_rtems() +{ + cd ${RTEMSDIR} + cvs up -Pd 2>&1 | grep -v ^cvs + ./bootstrap -c + ./bootstrap +} + +# HELPER - Update GCC +update_gcc() +{ + cd ${GCCDIR} + ./contrib/gcc_update +} + +# HELPER - Remove all the installed previous builds +clean_up() +{ + rm -rf install/* & + rm -rf bsp-install/* & + wait +} + +install_auto() +{ + for auto in ${AUTOCONF} ${AUTOMAKE} + do + cd ${auto} + make distclean + ./configure --prefix=${BASEDIR}/install + make all install + done +} + +# This handles GNU tools from CVS +update_others() +{ + for d in ${BINUTILSDIR} ${GDBDIR} ${NEWLIBDIR} + do + + case ${d} in + *cvs*) + cd ${d} + cvs up -P 2>&1 | grep -v ^cvs + ;; + *) + ;; + esac + done +} + +do_cpus() +{ + start=`date` + echo Started at: ${start} + + tests=-T + + bsp= + + exitStatus=0 + for cpu in $* + do + case $cpu in + native) bsp=native ;; + arm) bsp=edb7312 ;; + avr) bsp=avrtest ;; + bfin) bsp=eZKit533 ;; + h8300) bsp=h8sim ;; + i386) bsp=pc386 ;; + m32c) bsp=m32csim ;; + m32r) bsp=m32rsim ;; + m68k) bsp=mcf5206elite ;; + mips) bsp=jmr3904 ;; + powerpc) bsp=psim ;; + sh) bsp=simsh1 ;; + sparc) bsp=sis ;; + *) + echo "Unknown CPU ${cpu}" + exit 1 + ;; + esac + + doOne=${SCRIPTDIR}/gcc/do_one + # Everything + time sh -x ${doOne} -v -d -A ${tests} ${cpu} ${bsp} >${bsp}.log 2>&1 + # Just C + #time sh -x ${doOne} -v -b -D -1 -r ${tests} ${cpu} ${bsp} >${bsp}.log 2>&1 + # Just C/C++ + #time sh -x ${doOne} -v -1 -r -g ${tests} ${cpu} ${bsp} >${bsp}.log 2>&1 + echo $? + done + + + stopped=`date` + echo Started at: ${start} + echo Stopped at: ${stopped} +} + +if [ ${doCleanInstallPoint} = "yes" ] ; then + # Clean the install point + clean_up +fi + +# Update gcc and install autotools in parallel + if [ ${doCleanInstallPoint} = "yes" ] ; then + install_auto & + fi + if [ ${doUpdateTools} = "yes" ] ; then + update_gcc & + update_others & + fi +wait + +# Do any remaining prep work in parallel + if [ ${doUpdateRTEMS} = "yes" ] ; then + update_rtems & + fi +wait + +# Build the native compiler as a baseline to build the others + if [ ${doNative} = "yes" ] ; then + time sh -x ${SCRIPTDIR}/gcc/do_one -n >native.log 2>&1 + fi + +# Now cycle over all these CPUs +if [ $? -eq 0 ] ; then + if [ $# -eq 0 ] ; then + # Simulators included in gdb + do_cpus powerpc sh sparc powerpc h8300 mips sh m32c m32r + # Requires qemu installation + #do_cpus i386 + + # Requires Skyeye install + #do_cpus arm + + # TBD bfin m68k avr + else + for cpu in $* + do + do_cpus ${cpu} + done + fi + +fi + +stopped=`date` +echo Started at: ${start} +echo Stopped at: ${stopped} |