summaryrefslogtreecommitdiff
path: root/tests/build-tests.sh
blob: 15db42af98a4126c0cf6822f737762baa7196d20 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/sh
# test various compilation options
# - 32bit, 64bit
# - dynamic, static
# - various configure options
#
# Arguments: anything will be passed to 'make', eg. define CC, D, V
#
# Requirements for full coverage:
# - static version of all libs
# - 32bit/64bit libraries, also the static variants

make=make
opts="-j16 $@"

conf=
target=

function die() {
	echo "ERROR: $@"
	exit 1
}

function check_result() {
	local ret
	local str

	ret=$1

	str="RESULT of target($target) conf($conf): "
	case $ret in
		0) str="$str OK";;
		*) str="$str FAIL";;
	esac
	echo "$str"
	verdict="$verdict
$str"
}

function buildme() {
	make clean-all

	./autogen.sh && configure "$conf" || die "configure not working with: $@"
	$make clean
	$make $opts $target
	check_result "$?"
	echo "VERDICT: $verdict"
}

function build_make_targets() {
	# defaults
	target=
	buildme
	# defaults, static
	target=static
	buildme
	# defaults, 32bit
	target="EXTRA_CFLAGS=-m32"
	buildme
	# defaults, 64bit
	target="EXTRA_CFLAGS=-m64"
	buildme
	# defaults, library
	target="library-test"
	buildme
	# defaults, static library
	target="library-test.static"
	buildme
}

# main()
if ! [ -f configure.ac ]; then
	echo "Please run me from the top directory"
	exit 1
fi

verdict=
conf=
build_make_targets

conf='--disable-documentation'
build_make_targets

conf='--disable-backtrace'
build_make_targets

conf='--disable-convert'
build_make_targets

conf='--with-convert=ext2'
build_make_targets

conf='--with-convert=ext2,reiserfs'
build_make_targets

conf='--enable-zstd'
build_make_targets

# debugging builds, just the default targets
target='D=1'
buildme

target='D=asan'
buildme

target='D=tsan'
buildme

target='D=ubsan'
buildme

echo "---------------------------------------------------"
echo "$verdict"