36 lines · c
1//===-- Header for using Fuchsia's zxtest framework ------------*- 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#ifndef LLVM_LIBC_UTILS_UNITTEST_ZXTEST_H10#define LLVM_LIBC_UTILS_UNITTEST_ZXTEST_H11 12#include "src/__support/macros/config.h"13#include <zxtest/zxtest.h>14 15#define WITH_SIGNAL(X) #X16 17#ifndef EXPECT_DEATH18// Since zxtest has ASSERT_DEATH but not EXPECT_DEATH, wrap calling it19// in a lambda returning void to swallow any early returns so that this20// can be used in a function that itself returns non-void.21#define EXPECT_DEATH(FUNC, SIG) ([&] { ASSERT_DEATH(FUNC, SIG); }())22#endif23 24namespace LIBC_NAMESPACE_DECL {25namespace testing {26 27using Test = ::zxtest::Test;28 29} // namespace testing30} // namespace LIBC_NAMESPACE_DECL31 32// zxtest does not have gmock-style matchers.33#define LIBC_TEST_HAS_MATCHERS() (0)34 35#endif // LLVM_LIBC_UTILS_UNITTEST_ZXTEST_H36