#!/bin/bash -x # # here, we check a release for every possible enable/disable combination. # we enable or disable according to a bit combination of length #packets packets=("debug" "qtgui" "jobmarket" "vmg" "ecut") #"python" length=${#packets[*]} end=`units "2^$length" | awk -F": " {'print $2'}` function bitcheck { # $1 is the bit array # $2 is the length of the bit array # $3 is the bit to check (starting at 0) # we print 0 or 1 depending on the bit let inverse=$2-$3-1 bits=$1 while [ $inverse -gt 0 ]; do let bits=$bits/2 ((inverse-=1)) done let bit=$bits%2 echo $bit } if [ -z $1 ]; then echo "Usage: $0 [configure flags]" exit 1 fi SOURCEDIR="$1" shift DIR="$1" shift commit="$1" shift # variables to define LOG="`pwd`/commitcheck-${commit}" checkdir="commitchecking" cores=12 # check whether target is empty and create clone of git repo if [ -e $DIR ]; then echo "Target directory $DIR must not be present!" exit 255 fi echo -e "#Begin of Logfile" >${LOG}.log git clone $SOURCEDIR $DIR | tee -a ${LOG}.log DIR=`realpath $DIR` if [ ! $? -eq 0 ]; then echo "Please install realpath package!" exit 128 fi OLDDIR=`pwd` cd $DIR i=0 while [ $i -lt $end ]; do # GENERATING configure line configureline="--enable-python " j=0 while [ $j -lt ${#packets[*]} ]; do bit=`bitcheck $i $length $j` if [ $bit -eq 0 ]; then configureline=${configureline}" --disable-${packets[$j]}" else configureline=${configureline}" --enable-${packets[$j]}" fi ((j+=1)) done # PERFORMING CHECKS git checkout -f ${commit} # copy some overrides for testfile in `find tests -name 'Makefile.am'`; do sed -i -e "s#max_jobs = 4#max_jobs = $cores#" $testfile done ./bootstrap rm -rf $checkdir mkdir -p $checkdir cd $checkdir echo "Now testing version `git describe --dirty --always` with $configureline" &>${LOG}-${i}.log ../configure --prefix=${DIR}/$checkdir ${configureline} "$@" &>>${LOG}-${i}.log make -k -j${cores} check &>>${LOG}-${i}.log resultcode=$? # add failed testsuite.logs echo "#################################################################################" >>${LOG}-${i}.log for failedlog in `find tests/ -regex '.*/[0-9]*/.*' -name 'testsuite.log' -exec grep -l "FAILED" {} \;`; do echo -e "\t$failedlog" >>${LOG}-${i}.log echo "#################################################################################" >>${LOG}-${i}.log cat <$failedlog >>${LOG}-${i}.log echo "#################################################################################" >>${LOG}-${i}.log done if [ $resultcode -gt 0 ]; then echo -e "${i}: `git describe --dirty --always`, ${configureline}: FAILED." >>${LOG}.log else echo -e "${i}: `git describe --dirty --always`, ${configureline}: ok." >>${LOG}.log fi cd .. ((i+=1)) done cd $OLDDIR