2023-01-12 22:28:42 +01:00
|
|
|
// 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"
|
2023-06-02 18:00:51 +02:00
|
|
|
#include "Core/Core.h"
|
2023-01-12 22:28:42 +01:00
|
|
|
|
|
|
|
#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);
|
2023-06-02 18:00:51 +02:00
|
|
|
Core::DeclareAsHostThread();
|
2023-01-12 22:28:42 +01:00
|
|
|
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
}
|