From: Loic Dachary Date: Fri, 3 Apr 2015 02:36:10 +0000 (+0200) Subject: build-ceph: display make check errors when stored in .log X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1141ddbcd2ada78f072bc5ec2c3883476223cc9c;p=autobuild-ceph.git build-ceph: display make check errors when stored in .log Automake after a certain version started storing the make check logs in .log files. If a check fails, display the log so the user can figure out what went wrong. Signed-off-by: Loic Dachary --- diff --git a/build-ceph.sh b/build-ceph.sh index ad01ccf..9fa4198 100755 --- a/build-ceph.sh +++ b/build-ceph.sh @@ -59,13 +59,13 @@ function maybe_parallel_make_check() { fi } # -# Return MIN(8, MAX(1, (number of processors / 2))) -# Do not try to use more than 8 because it will stress +# Return MIN(4, MAX(1, (number of processors / 2))) +# Do not try to use more than 4 because it will stress # IO too much # function get_processors() { if test $(nproc) -ge 16 ; then - echo 8 + echo 4 elif test $(nproc) -ge 2 ; then expr $(nproc) / 2 else @@ -73,10 +73,23 @@ function get_processors() { fi } + +function display_failures() { + local dir=$1 + find $dir -name '*.trs' | xargs grep -l FAIL | while read file ; do + log=$(dirname $file)/$(basename $file .trs).log + echo FAIL: $log + cat $log + done +} + make -j$(get_processors) "$@" || exit 4 -# run "make check", but give it a time limit in case a test gets stuck -../maxtime 3600 make $(maybe_parallel_make_check) check "$@" || exit 5 +# run "make check", but give it a time limit in case a test gets stuck +if ! ../maxtime 3600 make $(maybe_parallel_make_check) check "$@" ; then + display_failures . + exit 5 +fi REV="$(git rev-parse HEAD)" OUTDIR="../out/output/sha1/$REV"