diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2022-07-03 05:41:15 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2022-07-06 00:25:17 +0300 |
commit | 7b6cede819a673cc21e896283668b2d3ddd9e623 (patch) | |
tree | 4142d8acda2b7e1da0cc2ed026450c7dab788300 | |
parent | 3acaa70965c5570ef1711fee9b3a15eac3e74ffe (diff) |
Add asan/ubsan support in random tests
-rwxr-xr-x | tests/random_config.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/random_config.sh b/tests/random_config.sh index e5d72833..aea0c389 100755 --- a/tests/random_config.sh +++ b/tests/random_config.sh @@ -40,8 +40,10 @@ arch=`echo -e "\n-march=core2\n-march=sandybridge\n-march=broadwell\n-march=skyl footprint=`echo -e "\n-DSMALL_FOOTPRINT" | shuf -n1` std=`echo -e "\n-std=c90\n-std=c99\n-std=c11\n-std=c17" | shuf -n1` +sanitize=`echo -e "\n-fsanitize=address -fno-sanitize-recover=all\n-fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow" | shuf -n1` -CFLAGS="$CFLAGS $std $opt $arch $footprint $math" + +CFLAGS="$CFLAGS $std $opt $arch $footprint $math $sanitize" echo CFLAGS=$CFLAGS > $config @@ -90,11 +92,12 @@ then exit 1 fi -#Run valgrind 10% of the time -if [ `seq 30 | shuf -n1` -ne 1 ] +#Run valgrind 5% of the time (minus the asan cases) +if [ `seq 20 | shuf -n1` -ne 1 -o "$sanitize" = "-fsanitize=address -fno-sanitize-recover=all" ] then make check > makecheck_output.txt 2>&1 else + echo valgrind enabled >> $config valgrind --trace-children=yes --error-exitcode=128 make check > makecheck_output.txt 2>&1 fi |