HelloAurora/Tests/Common/entrypoint.cpp
Reece 0ea0669f4a [+] Add cmd test
[*] Don't run gtest if there are no gtests available
[*] Update runtime
2022-02-20 18:03:05 +00:00

39 lines
1.0 KiB
C++

/***
Copyright (C) 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: entrypoint.cpp
Date: 2020-6-9
Originator: Reece
Purpose:
***/
#define _AURORA_RUNTIME_BUILD_API_INTERFACES
#include <AuroraCommon.hpp>
#include <AuroraRuntime.hpp>
#include "gtest/gtest.h"
#include "test.hpp"
#include "unit.hpp"
#include "console.hpp"
using namespace Aurora::UnitTesting;
extern void RunTests();
int main(int argsc, const char ** argsv)
{
Aurora::UnitTesting::Console::Init();
RunTests();
::testing::InitGoogleTest(&argsc, (char **)argsv);
if (::testing::UnitTest::GetInstance()->total_test_count())
{
UnitAssert(RUN_ALL_TESTS() == 0, "gtest failed");
}
if (Aurora::RuntimeHasStarted())
{
Aurora::RuntimeShutdown();
}
Aurora::UnitTesting::Console::Log(" Single unit test executable passed without a failed assertion.");
Aurora::UnitTesting::Console::Log(" Returning exitcode encoded TestResponse::kPass w/ magic");
return ToExitCode(TestResponse::kPass);
}