1 //===-- asan_test_main.cc -------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file is a part of AddressSanitizer, an address sanity checker. 11 // 12 //===----------------------------------------------------------------------===// 13 #include "asan_test_utils.h" 14 #include "sanitizer_common/sanitizer_platform.h" 15 16 // Default ASAN_OPTIONS for the unit tests. Let's turn symbolication off to 17 // speed up testing (unit tests don't use it anyway). 18 extern "C" const char* __asan_default_options() { 19 #if SANITIZER_MAC 20 // On Darwin, we default to `abort_on_error=1`, which would make tests run 21 // much slower. Let's override this and run lit tests with 'abort_on_error=0'. 22 // Also, make sure we do not overwhelm the syslog while testing. 23 return "symbolize=false:abort_on_error=0:log_to_syslog=0"; 24 #else 25 return "symbolize=false"; 26 #endif 27 } 28 29 namespace __sanitizer { 30 bool ReexecDisabled() { 31 return true; 32 } 33 } 34 35 int main(int argc, char **argv) { 36 testing::GTEST_FLAG(death_test_style) = "threadsafe"; 37 testing::InitGoogleTest(&argc, argv); 38 return RUN_ALL_TESTS(); 39 } 40