aboutsummaryrefslogtreecommitdiff
path: root/ci/jobs/1-test/test.sh
blob: 6c3d2be21ae5f2f8ee363bb38eb62104a507c2b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -evu

./bootstrap
./configure CFLAGS="-ggdb -O0" \
	    --enable-logging=verbose \
	    --disable-doc
make
make install


check_command()
{
	# Set LD_LIBRARY_PATH so tests can find the installed libs
	LD_LIBRARY_PATH=/usr/local/lib make check
}

print_logs()
{
	for i in src/*/test-suite.log
	do
		FAILURE="$(grep '^FAIL:' ${i} | cut -d' ' -f2)"
		if [ ! -z "${FAILURE}" ]; then
			echo "Printing ${FAILURE}.log"
			tail "$(dirname $i)/${FAILURE}.log"
		fi
	done
}

if ! check_command ; then
	print_logs
	exit 1
fi