summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2021-02-02 21:04:18 +0000
committerColin Walters <walters@verbum.org>2021-02-02 21:09:23 +0000
commit6b5aef761298a5f750b5893c063e8f9e18e5d5c9 (patch)
tree1ac829ea9200fd55efa0be50df4d08109589fee3
parentafb032e6938fe0ce7480156f65c3b487a9234dfb (diff)
downloadostree-6b5aef761298a5f750b5893c063e8f9e18e5d5c9.tar.gz
ci: Add new build-check-sanitized.sh
All C/C++ projects should use the sanitizers (and static analysis) in their CI. We had this but lost it in one of our CI shuffles; let's readd it.
-rwxr-xr-xci/build-check-sanitized.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/ci/build-check-sanitized.sh b/ci/build-check-sanitized.sh
new file mode 100755
index 00000000..39c06f43
--- /dev/null
+++ b/ci/build-check-sanitized.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/bash
+# Build with ASAN and UBSAN + unit tests.
+
+set -xeuo pipefail
+
+dn=$(dirname $0)
+. ${dn}/libbuild.sh
+export CFLAGS='-fsanitize=address -fsanitize=undefined -fsanitize-undefined-trap-on-error'
+# We leak global state in a few places, fixing that is hard.
+export ASAN_OPTIONS='detect_leaks=0'
+${dn}/build.sh
+make check