monotone

monotone Mtn Source Tree

Root/contrib/dump-test-logs.sh

1#! /bin/sh
2
3# Dump the detailed logs for all tests with an unexpected outcome to
4# stdout. This is intended for use in super-automated build
5# environments, e.g. the Debian build daemons, where the easiest way
6# to recover detailed test logs for a failed build is to embed them in
7# the overall 'make' output. Run, with no arguments, from the top
8# level of a monotone build tree.
9
10# Conveniently enough, testlib.lua does most of the work for us.
11
12for log in tester_dir/*.log
13do
14 if grep "0 failed" < $log > /dev/null 2>&1 &&
15 grep "0 succeeded unexpectedly" < $log > /dev/null 2>&1
16 then :
17 else
18echo
19echo "### $log ###"
20echo
21sed -ne '/^Running tests/,/^$/!p' < $log
22 fi
23done
24
25# Always exit unsuccessfully, so that a driver Makefile
26# can do something like
27#
28# make check || sh dump-test-logs.sh
29#
30# and have that fail the build just like plain "make check" would.
31# (The above should dump something if and only if the preceding "make
32# check" failed, but that has been unreliable in the past.)
33exit 1

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status