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)}
13 function prepare_build_dir
()
15 if [ -d ${BUILD} ] ; then
25 if [ ${result} -eq 0 ] ; then
26 echo "SUCCESS" >> ${logfile}
27 echo -e " \033[32mSUCCESS\033[0m"
29 echo "FAILURE" >> ${logfile}
30 echo -e " \033[31mFAILURE\033[0m"
34 function build_with_local_installation
()
36 for cfg
in $
(${SCRIPT_BASE}/bld
--list |
grep -E "clang[0-9]+|gcc[0-9]+") ; do
37 echo -n "target: ${cfg} "
38 printf '%*s' $
((45 - ${#cfg})) "" |
tr ' ' '.'
40 BUILD_DIR
=${BUILD}/${cfg} ${SCRIPT_BASE}/bld ${cfg} >&${BUILD}/${cfg}.log
41 log_result $?
${BUILD}/${cfg}.log
43 rm -fr ${BUILD}/${cfg}
47 function build_with_docker
()
52 for dockerid
in $
(docker images
${account}${name} |
grep -Ev "REPOSITORY" |
sed -E 's/^([^[:space:]]+)\s+([^[:space:]]+)\s+.*$/\1:\2/' |
sort -Vur) ; do
53 for build_type
in Debug Release
; do
54 cfg
=$
(echo "${dockerid}_${build_type}" |
tr '/:' '__')
56 echo -n "target: ${cfg} "
57 printf '%*s' $
((45 - ${#cfg})) "" |
tr ' ' '.'
59 BUILD_DIR
=${BUILD}/${cfg} ${SCRIPT_BASE}/docker-build.sh "$(echo ${dockerid} | sed "s@${account}${name}:@@")" ${build_type} >&${BUILD}/${cfg}.log
60 log_result $?
${BUILD}/${cfg}.log
62 rm -fr ${BUILD}/${cfg}
68 build_with_local_installation