JDevlieghere created this revision.
JDevlieghere added reviewers: aprantl, augusto2112.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
JDevlieghere requested review of this revision.

Set the `halt_on_error` runtime flag to make TSan errors fatal when running the 
test suite. For the API tests the environment variables are set conditionally 
on whether the TSan is enabled. The Shell tests don't have that logic and I 
don't think it's worth duplicating it as setting the environment variable is 
harmless. For consistency, I've also mirrored the ASAN option 
(`detect_stack_use_after_return=1`) for the Shell tests.


https://reviews.llvm.org/D157152

Files:
  lldb/test/API/lit.cfg.py
  lldb/test/Shell/lit.cfg.py


Index: lldb/test/Shell/lit.cfg.py
===================================================================
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -48,6 +48,10 @@
     ]
 )
 
+# Enable sanitizer runtime flags.
+config.environment["ASAN_OPTIONS"] = "detect_stack_use_after_return=1"
+config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
+
 # Support running the test suite under the lldb-repro wrapper. This makes it
 # possible to capture a test suite run and then rerun all the test from the
 # just captured reproducer.
Index: lldb/test/API/lit.cfg.py
===================================================================
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -123,6 +123,7 @@
             )
 
     if "Thread" in config.llvm_use_sanitizer:
+        config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
         if "Darwin" in config.host_os:
             config.environment["DYLD_INSERT_LIBRARIES"] = 
find_sanitizer_runtime(
                 "libclang_rt.tsan_osx_dynamic.dylib"


Index: lldb/test/Shell/lit.cfg.py
===================================================================
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -48,6 +48,10 @@
     ]
 )
 
+# Enable sanitizer runtime flags.
+config.environment["ASAN_OPTIONS"] = "detect_stack_use_after_return=1"
+config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
+
 # Support running the test suite under the lldb-repro wrapper. This makes it
 # possible to capture a test suite run and then rerun all the test from the
 # just captured reproducer.
Index: lldb/test/API/lit.cfg.py
===================================================================
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -123,6 +123,7 @@
             )
 
     if "Thread" in config.llvm_use_sanitizer:
+        config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
         if "Darwin" in config.host_os:
             config.environment["DYLD_INSERT_LIBRARIES"] = find_sanitizer_runtime(
                 "libclang_rt.tsan_osx_dynamic.dylib"
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to