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 int main(int argc, char **argv) { 30 testing::GTEST_FLAG(death_test_style) = "threadsafe"; 31 testing::InitGoogleTest(&argc, argv); 32 return RUN_ALL_TESTS(); 33 } 34