summaryrefslogtreecommitdiff
path: root/Source/UnitTests/UnitTestsMain.cpp
blob: 4eed0c60993e17ca4f1bd9ccdb642cb1a2882fae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Based on gtest_main.cc

#include <cstdio>
#include <fmt/format.h>

#include "Common/MsgHandler.h"
#include "Core/Core.h"

#include "gtest/gtest.h"

namespace
{
bool TestMsgHandler(const char* caption, const char* text, bool yes_no, Common::MsgType style)
{
  fmt::print(stderr, "{}\n", text);
  ADD_FAILURE();
  // Return yes to any question (we don't need Dolphin to break on asserts)
  return true;
}
}  // namespace

int main(int argc, char** argv)
{
  fmt::print(stderr, "Running main() from UnitTestsMain.cpp\n");
  Common::RegisterMsgAlertHandler(TestMsgHandler);
  Core::DeclareAsHostThread();

  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}