NMEA: TODO added.
[marnav.git] / bin / test-buildall
blob79e6ce51f8972606e06ecc7c14c5b24719996043
1 #!/bin/bash -eu
3 # builds all relevant configurations, executes tests
5 export SCRIPT_BASE=$(dirname `readlink -f $0`)
6 export BASE=${SCRIPT_BASE}/..
7 export BUILD=${BASE}/build
9 # ask system about number of processors, accept already specified number
10 export NUM_PROC=${NUM_PROC:-$(cat /proc/cpuinfo | grep -E "^processor" | wc -l)}
12 # prepare master build directory
13 if [ -d ${BUILD} ] ; then
14 rm -fr ${BUILD}
16 mkdir -p ${BUILD}
18 # execute builds
19 for cfg in $(${SCRIPT_BASE}/bld --list | grep -E "clang[0-9]+|gcc[0-9]+") ; do
20 echo -n "target: ${cfg} "
21 printf '%*s' $((40 - ${#cfg})) "" | tr ' ' '.'
22 set +e
23 BUILD_DIR=${BUILD}/${cfg} ${SCRIPT_BASE}/bld ${cfg} >&${BUILD}/${cfg}.log
24 if [ $? -eq 0 ] ; then
25 echo "SUCCESS" >> ${BUILD}/${cfg}.log
26 echo -e " \033[32mSUCCESS\033[0m"
27 else
28 echo "FAILURE" >> ${BUILD}/${cfg}.log
29 echo -e " \033[31mFAILURE\033[0m"
31 set -e
32 rm -fr ${BUILD}/${cfg}
33 done