-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun-precommit-checks.sh
executable file
·41 lines (30 loc) · 1.08 KB
/
run-precommit-checks.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
#!/bin/sh -ex
export CXX
cd "$(dirname "$0")"
if [ -n "$1" ] ; then
builddir="$1"
mkdir -p "$builddir"
else
builddir="$(mktemp -d /tmp/relaunchd-build-precommit.XXXXXXXX)"
trap 'rm -rf "$builddir"' EXIT
fi
./configure --objdir="$builddir"
make -C "$builddir" clean clang-analyzer-report
make -C "$builddir" clean all check
# Sanitizers are not working on MacOS yet
if [ "$(uname)" != "Darwin" ] ; then
# TODO: we could run these in parallel if each test-all executable
# had a unique TMPDIR
make -C "$builddir" check-valgrind check-asan check-ubsan
# DISABLED - false positives suspected. Try using valgrind instead.
# ./configure --objdir="$builddir" --enable-msan
# make -C "$builddir" clean check
fi
./configure --objdir="$builddir" --build-type=release
make -C "$builddir" clean all check
# TODO: would like this, but too many errors right now
#clang-tidy -format-style=file -header-filter=. -p $builddir --checks=\* src/*.cc
#run-clang-tidy -header-filter=.\* -p $builddir \
# -checks=bugprone\*,cert-\*,cppcoreguidelines-\*
# src/*.cc
echo "+++ SUCCESS: All tests passed +++"