blob: cdaf801d914ba729ba196962dca4553519d143d0 [file] [log] [blame]
Alexey Samsonovde55be32012-10-17 14:04:57 +00001//===-- 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"
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080014#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).
18extern "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}
Alexey Samsonovde55be32012-10-17 14:04:57 +000028
29int main(int argc, char **argv) {
30 testing::GTEST_FLAG(death_test_style) = "threadsafe";
31 testing::InitGoogleTest(&argc, argv);
32 return RUN_ALL_TESTS();
33}