1 //===-- scudo_unit_test.h ---------------------------------------*- C++ -*-===//
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-exception
7 //===----------------------------------------------------------------------===//
12 #include <zxtest/zxtest.h>
13 using Test
= ::zxtest::Test
;
15 #include "gtest/gtest.h"
16 using Test
= ::testing::Test
;
19 // If EXPECT_DEATH isn't defined, make it a no-op.
21 // If ASSERT_DEATH is defined, make EXPECT_DEATH a wrapper to it.
23 #define EXPECT_DEATH(X, Y) ASSERT_DEATH(([&] { X; }), "")
25 #define EXPECT_DEATH(X, Y) \
28 #endif // ASSERT_DEATH
29 #endif // EXPECT_DEATH
31 // If EXPECT_STREQ isn't defined, define our own simple one.
33 #define EXPECT_STREQ(X, Y) EXPECT_EQ(strcmp(X, Y), 0)
37 #define SKIP_ON_FUCHSIA(T) DISABLED_##T
39 #define SKIP_ON_FUCHSIA(T) T
43 #define SKIP_NO_DEBUG(T) T
45 #define SKIP_NO_DEBUG(T) DISABLED_##T
49 // The zxtest library provides a default main function that does the same thing
50 // for Fuchsia builds.
51 #define SCUDO_NO_TEST_MAIN
54 extern bool UseQuarantine
;