aboutsummaryrefslogtreecommitdiff
path: root/test/travis-build.sh
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2017-06-20 13:53:55 -0700
committerNikolaus Rath <Nikolaus@rath.org>2017-06-22 14:22:57 -0700
commit5f4619bac33a544af4da6e7d28bb4d7dbe45ae92 (patch)
treeab79661111460b9aab6a7b9452dfcf52a59a90de /test/travis-build.sh
parentb66ecb9c3a1d4a7756ad48c61a8b2e82b08f1e8c (diff)
downloadsshfs-5f4619bac33a544af4da6e7d28bb4d7dbe45ae92.tar
sshfs-5f4619bac33a544af4da6e7d28bb4d7dbe45ae92.tar.gz
sshfs-5f4619bac33a544af4da6e7d28bb4d7dbe45ae92.tar.bz2
sshfs-5f4619bac33a544af4da6e7d28bb4d7dbe45ae92.zip
Added unit tests and travis integration
Diffstat (limited to 'test/travis-build.sh')
-rwxr-xr-xtest/travis-build.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/travis-build.sh b/test/travis-build.sh
new file mode 100755
index 0000000..ba04295
--- /dev/null
+++ b/test/travis-build.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+set -e
+
+# Disable leak checking for now, there are some issues (or false positives)
+# that we still need to fix
+export ASAN_OPTIONS="detect_leaks=0"
+
+export LSAN_OPTIONS="suppressions=$(pwd)/test/lsan_suppress.txt"
+export CC
+
+TEST_CMD="python3 -m pytest --maxfail=99 test/"
+
+# Standard build with Valgrind
+for CC in gcc gcc-6 clang; do
+ mkdir build-${CC}; cd build-${CC}
+ if [ ${CC} == 'gcc-6' ]; then
+ build_opts='-D b_lundef=false'
+ else
+ build_opts=''
+ fi
+ meson -D werror=true ${build_opts} ../
+ ninja
+
+ TEST_WITH_VALGRIND=true ${TEST_CMD}
+ cd ..
+done
+(cd build-$CC; sudo ninja install)
+
+# Sanitized build
+CC=clang
+for san in undefined address; do
+ mkdir build-${san}; cd build-${san}
+ # b_lundef=false is required to work around clang
+ # bug, cf. https://groups.google.com/forum/#!topic/mesonbuild/tgEdAXIIdC4
+ meson -D b_sanitize=${san} -D b_lundef=false -D werror=true ..
+ ninja
+ ${TEST_CMD}
+ cd ..
+done
+
+# Autotools build
+CC=gcc
+autoreconf -i
+./configure
+make
+${TEST_CMD}
+sudo make install