meson: cpu-emu
[qemu/ar7.git] / tests / docker / test-tsan
blobeb40ac45b7a44da2656ea506867d9e60892ff8a3
1 #!/bin/bash -e
3 # This test will use TSan as part of a build and a make check.
5 # Copyright (c) 2020 Linaro
6 # Copyright (c) 2016 Red Hat Inc.
8 # Authors:
9 # Robert Foley <robert.foley@linaro.org>
10 # Originally based on test-quick from Fam Zheng <famz@redhat.com>
12 # This work is licensed under the terms of the GNU GPL, version 2
13 # or (at your option) any later version. See the COPYING file in
14 # the top-level directory.
16 . common.rc
18 setup_tsan()
20 requires clang tsan
21 tsan_log_dir="/tmp/qemu-test/build/tsan"
22 mkdir -p $tsan_log_dir > /dev/null || true
23 EXTRA_CONFIGURE_OPTS="${EXTRA_CONFIGURE_OPTS} --enable-tsan \
24 --cc=clang-10 --cxx=clang++-10 \
25 --disable-werror --extra-cflags=-O0"
26 # detect deadlocks is false currently simply because
27 # TSan crashes immediately with deadlock detector enabled.
28 # We have maxed out the history size to get the best chance of finding
29 # warnings during testing.
30 # Note, to get TSan to fail on warning, use exitcode=66 below.
31 tsan_opts="suppressions=/tmp/qemu-test/src/tests/tsan/suppressions.tsan\
32 detect_deadlocks=false history_size=7\
33 halt_on_error=0 exitcode=0 verbose=5\
34 log_path=$tsan_log_dir/tsan_warning"
35 export TSAN_OPTIONS="$tsan_opts"
38 cd "$BUILD_DIR"
40 TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
41 setup_tsan
42 build_qemu
43 check_qemu
44 install_qemu