diff --git a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt --- a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt +++ b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt @@ -71,6 +71,11 @@ endif() endmacro() +set(SCUDO_UNIT_TEST_MAIN_SOURCES + scudo_unit_test.cpp + scudo_unit_test_main.cpp + ) + set(SCUDO_UNIT_TEST_SOURCES atomic_test.cpp bytemap_test.cpp @@ -91,15 +96,14 @@ strings_test.cpp tsd_test.cpp vector_test.cpp - scudo_unit_test_main.cpp ) add_scudo_unittest(ScudoUnitTest - SOURCES ${SCUDO_UNIT_TEST_SOURCES}) + SOURCES ${SCUDO_UNIT_TEST_SOURCES} ${SCUDO_UNIT_TEST_MAIN_SOURCES}) set(SCUDO_C_UNIT_TEST_SOURCES wrappers_c_test.cpp - scudo_unit_test_main.cpp + ${SCUDO_UNIT_TEST_MAIN_SOURCES} ) add_scudo_unittest(ScudoCUnitTest @@ -108,7 +112,7 @@ set(SCUDO_CXX_UNIT_TEST_SOURCES wrappers_cpp_test.cpp - scudo_unit_test_main.cpp + ${SCUDO_UNIT_TEST_MAIN_SOURCES} ) add_scudo_unittest(ScudoCxxUnitTest diff --git a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.cpp copy from compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp copy to compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.cpp --- a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.cpp @@ -1,4 +1,4 @@ -//===-- scudo_unit_test_main.cpp --------------------------------*- C++ -*-===// +//===-- scudo_unit_test.cpp --------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -28,12 +28,3 @@ "quarantine_max_chunk_size=512:" "dealloc_type_mismatch=" DEALLOC_TYPE_MISMATCH; } - -int main(int argc, char **argv) { -#if !SCUDO_FUCHSIA - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -#else - return RUN_ALL_TESTS(argc, argv); -#endif -} diff --git a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp --- a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp @@ -8,27 +8,6 @@ #include "tests/scudo_unit_test.h" -// Match Android's default configuration, which disables Scudo's mismatch -// allocation check, as it is being triggered by some third party code. -#if SCUDO_ANDROID -#define DEALLOC_TYPE_MISMATCH "false" -#else -#define DEALLOC_TYPE_MISMATCH "true" -#endif - -// This allows us to turn on/off a Quarantine for specific tests. The Quarantine -// parameters are on the low end, to avoid having to loop excessively in some -// tests. -bool UseQuarantine = true; -extern "C" __attribute__((visibility("default"))) const char * -__scudo_default_options() { - if (!UseQuarantine) - return "dealloc_type_mismatch=" DEALLOC_TYPE_MISMATCH; - return "quarantine_size_kb=256:thread_local_quarantine_size_kb=128:" - "quarantine_max_chunk_size=512:" - "dealloc_type_mismatch=" DEALLOC_TYPE_MISMATCH; -} - int main(int argc, char **argv) { #if !SCUDO_FUCHSIA testing::InitGoogleTest(&argc, argv);