summaryrefslogtreecommitdiff
path: root/test_driver
blob: 87be080ea5dac135f2eea338859933bc7eab653a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#! /bin/sh
#
#  Test Driver
#
#  $Id$
#

vfile=`dirname $0`/VERSIONS
if [ ! -r ${vfile} ] ; then
  echo VERSIONS file not found
  exit 1
fi

source ${vfile}

start=`date`
echo Started at: ${start}

BASEDIR=`pwd`

# 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
    if [ ! -d ${auto} ] ; then
      echo "${d} not installed"
      exit 0
    fi
    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}/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}
}

# Clean the install point
clean_up

# Update gcc and install autotools in parallel
install_auto &
update_gcc &
update_others &
wait

# Do any remaining prep work in parallel
update_rtems &
wait

# Build the native compiler as a baseline to build the others
time sh -x ${SCRIPTDIR}/do_one -n >native.log 2>&1

# Now cycle over all these CPUs
if [ $? -eq 0 ] ; then
  do_cpus powerpc sh sparc
  #${SCRIPTDIR}/do_cpus m32c arm h8300 i386 mips sh powerpc sparc
  #${SCRIPTDIR}/do_cpus i386 
  # wait
fi
# ${SCRIPTDIR}/do_cpus sparc powerpc mips i386 arm

stopped=`date`
echo Started at: ${start}
echo Stopped at: ${stopped}