-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathci_build.sh
executable file
·67 lines (55 loc) · 3.03 KB
/
ci_build.sh
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
#!/bin/sh -xe
# This file is part of b6b.
#
# Copyright 2017, 2018, 2019, 2020 Dima Krasner
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
meson --default-library=static -Dwith_valgrind=true build-gcc
CC="ccache clang" meson --unity=on --unity-size=100 -Dwith_valgrind=true build-clang
meson --unity=on --unity-size=100 -Dwith_threads=false -Dwith_valgrind=true build-no-threads
meson --unity=on --unity-size=100 -Dwith_threads=false -Dwith_miniz=false -Dwith_linenoise=false build-small
meson --unity=on --unity-size=100 --optimization=3 -Db_sanitize=address build-asan
ninja -C build-gcc
meson configure --default-library=shared --unity=on --unity-size=100 build-gcc
# build with GCC, clang, with GCC while thread support is disabled and a small build with all optional features off
for i in build-gcc build-clang build-no-threads
do
ninja -C $i
meson configure --optimization=3 -Dwith_miniz=false -Db_lto=true $i
DESTDIR=dest ninja -C $i install
done
DESTDIR=dest ninja -C build-small install
meson test -C build-small --no-rebuild --print-errorlogs
# rebuild the small build with a static library
meson configure -Ddefault_library=static build-small
DESTDIR=dest-static ninja -C build-small install
for i in build-gcc build-clang
do
# run all single-threaded tests
meson test -C $i --no-rebuild --print-errorlogs --no-suite b6b:threaded
# run multi-threaded tests on a single CPU and 5 additional times, to increase the chance of triggering race conditions
meson test -C $i --no-rebuild --print-errorlogs --suite b6b:threaded --wrapper "taskset -c 0"
meson test -C $i --no-rebuild --print-errorlogs --suite b6b:threaded --repeat 5
done
# run all tests except extremely slow ones with AddressSanitizer
meson test -C build-asan --print-errorlogs --no-suite b6b:intensive -t 2
# this is required to work around missing suppressions in glibc's symbol lookup
export LD_BIND_NOW=1
for i in build-gcc build-clang
do
# run all tests except extremely slow ones with Valgrind
meson test -C $i --no-rebuild --print-errorlogs --no-suite b6b:slow --num-processes 1 -t 3 --wrapper "valgrind --leak-check=full --error-exitcode=1 --malloc-fill=1 --free-fill=1 --track-fds=yes"
# run multi-threaded tests with Helgrind
meson test -C $i --no-rebuild --print-errorlogs --suite b6b:threaded --no-suite b6b:intensive --num-processes 1 -t 3 --wrapper "valgrind --tool=helgrind --error-exitcode=1"
meson test -C $i --no-rebuild --print-errorlogs --suite b6b:threaded --no-suite b6b:intensive --num-processes 1 -t 3 --wrapper "valgrind --tool=helgrind --error-exitcode=1 --fair-sched=yes"
done