unit-test: Make UBSAN kill tests
Continuing to exploit the runtime library means we get useful
diagnostics printed rather than just the application generating a core.
Change-Id: I0b93e61bbca48eb5a79ba6fa9228431d36504f64
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/scripts/unit-test.py b/scripts/unit-test.py
index 21b7022..815dd17 100755
--- a/scripts/unit-test.py
+++ b/scripts/unit-test.py
@@ -224,7 +224,7 @@
child.PrintTree(level + 1)
-def check_call_cmd(*cmd):
+def check_call_cmd(*cmd, **kwargs):
"""
Verbose prints the directory location the given command is called from and
the command, then executes the command using check_call.
@@ -234,7 +234,7 @@
cmd List of parameters constructing the complete command
"""
printline(os.getcwd(), ">", " ".join(cmd))
- check_call(cmd)
+ check_call(cmd, **kwargs)
def clone_pkg(pkg, branch):
@@ -1065,6 +1065,7 @@
"--print-errorlogs",
"--logbase",
"testlog-ubasan",
+ env=os.environ | {"UBSAN_OPTIONS": "halt_on_error=1"},
)
# TODO: Fix memory sanitizer
# check_call_cmd('meson', 'configure', 'build',