summaryrefslogtreecommitdiff
path: root/tools/check
blob: 63a5c6db99987aff6838d6866c30995e42f0b304 (plain) (blame)
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
34
35
36
37
38
39
40
#!/bin/sh

set -e

types="debug release coverage"

mkdir -p build
cd build

for type in $types
do
	rm -rf $type
	mkdir -p $type
	cd $type
	case $type in
		debug)
			CFLAGS="-O0 -g3 -fsanitize=address,undefined"
			OTHER=""
			;;
		coverage)
			CFLAGS="-O0 -g3 --coverage -fcondition-coverage"
			OTHER="--disable-shared"
			;;
		release)
			CFLAGS="-O3"
			OTHER=""
			;;
		*)
			echo "Unsupported type"
			exit 1
			;;
	esac
	../../configure --enable-maintainer-mode --enable-build-mode=$type CFLAGS="$CFLAGS -Wall -Wextra -Werror -std=c89 -pedantic" $OTHER
	make -j check
	../../configure --enable-maintainer-mode --enable-build-mode=$type CFLAGS="$CFLAGS" $OTHER
	cd ..
done

cd ..
fossil ls | entr -c tools/tests $types