-
Notifications
You must be signed in to change notification settings - Fork 27
/
run-tests
executable file
·31 lines (28 loc) · 1.05 KB
/
run-tests
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
#!/bin/bash -e
case $0 in (/*) cd "${0%/*}/";; (*/*) cd "./${0%/*}";; esac
if command -v dnf >/dev/null; then
sudo dnf install python3dist\({coverage,pytest,gbulb,pyinotify,pytest-asyncio}\) || :
fi
if pkg-config vchan-socket; then
if [[ -n "${USE_ASAN-}" ]]; then
export CFLAGS=-fsanitize=address,undefined
export LDFLAGS=-fsanitize=address,undefined
# MUST use clang here. GCC causes random SIGSEGV crashes
# when ASAN and UBSAN is in use. Release build (no sanitizers)
# works fine.
export CC=clang
export ASAN_OPTIONS=leak_check_at_exit=0
else
export CFLAGS="--coverage -DCOVERAGE"
export LDFLAGS=--coverage
fi
make -C libqrexec BACKEND_VMM=socket clean all
make -C agent BACKEND_VMM=socket clean all
make -C daemon BACKEND_VMM=socket clean all
else
echo "libvchan-socket not available, skipping socket tests"
export SKIP_SOCKET_TESTS=1
fi
if [[ "$#" = 0 ]]; then set -- -v qrexec/tests; fi
set -x
python3 -m coverage run -m pytest -o 'python_files=*.py' "$@"