aboutsummaryrefslogtreecommitdiff
path: root/scripts/travis.sh
blob: 5662f5f06d1de5976dbf6f386c29c70a19ed35c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

export VALGRIND_CHECK=1
make cmake CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$PWD/dist" || exit 1
make || exit 1
echo "Running tests with valgrind..."
if ! make test > /dev/null 2>&1; then
	failed=$(ls src/testdir/valgrind.*)
	if [ -n "$failed" ]; then
		echo "Memory leak detected" >&2 
		cat src/testdir/valgrind.*
	else
		echo "Failed tests:" >&2 
		for t in src/testdir/*.failed; do
			echo ${t%%.*}
		done	
	fi
	exit 1
fi
make install