]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Enable AddressSanitizer error detection in tdir tests.
authorYorgos Thessalonikefs <yorgos@nlnetlabs.nl>
Fri, 31 May 2024 10:08:43 +0000 (12:08 +0200)
committerYorgos Thessalonikefs <yorgos@nlnetlabs.nl>
Fri, 31 May 2024 10:08:43 +0000 (12:08 +0200)
testcode/mini_tdir.sh

index 624ecdf7fe5b4116d86058424ac0fc1424eb2488..d1f7bfce94a8ffceb7ee0f8150c829043dfea568 100755 (executable)
@@ -127,6 +127,7 @@ dir=$name.$$
 result=result.$name
 done=.done-$name
 skip=.skip-$name
+asan_text="SUMMARY: AddressSanitizer"
 success="no"
 if test -x "`which bash`"; then
        shell="bash"
@@ -200,6 +201,16 @@ if test -f $name.post -a ! -f ../$skip; then
                echo "Warning: $name.post did not exit successfully"
        fi
 fi
+# Check if there were any AddressSanitizer errors
+# if compiled with -fsanitize=address
+if grep "$asan_text" $result >/dev/null 2>&1; then
+       if test -f ../$done; then
+               rm ../$done
+       fi
+       echo "$name: FAILED (AddressSanitizer)" >> $result
+       echo "$name: FAILED (AddressSanitizer)"
+       success="no"
+fi
 echo "DateRunEnd: "`date "+%s" 2>/dev/null` >> $result
 
 mv $result ..