brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · ca560fc Raw
38 lines · cpp
1//===--- rtsan_test_main.cpp - Realtime Sanitizer ---------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9//===----------------------------------------------------------------------===//10 11#include "sanitizer_common/sanitizer_platform.h"12#include "sanitizer_test_utils.h"13 14// Default RTSAN_OPTIONS for the unit tests.15extern "C" const char *__rtsan_default_options() {16#if SANITIZER_APPLE17  // On Darwin, we default to `abort_on_error=1`, which would make tests run18  // much slower. Let's override this and run lit tests with 'abort_on_error=0'19  // and make sure we do not overwhelm the syslog while testing. Also, let's20  // turn symbolization off to speed up testing, especially when not running21  // with llvm-symbolizer but with atos.22  return "symbolize=false:"23         "abort_on_error=0:"24         "log_to_syslog=0:"25         "verify_interceptors=0:"; // some of our tests don't need interceptors26#else27  // Let's turn symbolization off to speed up testing (more than 3 times speedup28  // observed).29  return "symbolize=false";30#endif31}32 33int main(int argc, char **argv) {34  testing::GTEST_FLAG(death_test_style) = "threadsafe";35  testing::InitGoogleTest(&argc, argv);36  return RUN_ALL_TESTS();37}38