Use gtest recommandation and provide global environment through main
Some checks failed
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 6m14s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Clang Format Checks (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Some checks failed
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 6m14s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Clang Format Checks (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
This commit is contained in:
@@ -1,32 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file Environment.cpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#include <Utils/Log/LogMacros.hpp>
|
|
||||||
#include <Utils/TargetMacros.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
namespace Bigfoot
|
|
||||||
{
|
|
||||||
class TestingEnvironment: public ::testing::Environment
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void SetUp() override
|
|
||||||
{
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.emplace());
|
|
||||||
}
|
|
||||||
|
|
||||||
void TearDown() override
|
|
||||||
{
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.reset());
|
|
||||||
}
|
|
||||||
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(eastl::optional<Singleton<Log>::Lifetime> m_lifetime);
|
|
||||||
};
|
|
||||||
} // namespace Bigfoot
|
|
||||||
|
|
||||||
// This runs before main() and registers the environment
|
|
||||||
const ::testing::Environment* const kEnv = ::testing::AddGlobalTestEnvironment(new Bigfoot::TestingEnvironment());
|
|
||||||
19
Bigfoot/Tests/Engine/EngineTests/main.cpp
Normal file
19
Bigfoot/Tests/Engine/EngineTests/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/*********************************************************************
|
||||||
|
* \file main.cpp
|
||||||
|
*
|
||||||
|
* \author Romain BOULLARD
|
||||||
|
* \date May 2026
|
||||||
|
*********************************************************************/
|
||||||
|
#include <Utils/Log/LogMacros.hpp>
|
||||||
|
#include <Utils/TargetMacros.h>
|
||||||
|
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
testing::InitGoogleTest(&argc, argv);
|
||||||
|
|
||||||
|
BIGFOOT_NOT_OPTIMIZED_ONLY(::Bigfoot::Singleton<::Bigfoot::Log>::Lifetime m_lifetime);
|
||||||
|
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file Environment.cpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#include <Utils/Log/LogMacros.hpp>
|
|
||||||
#include <Utils/TargetMacros.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
namespace Bigfoot
|
|
||||||
{
|
|
||||||
class TestingEnvironment: public ::testing::Environment
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void SetUp() override
|
|
||||||
{
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.emplace());
|
|
||||||
}
|
|
||||||
|
|
||||||
void TearDown() override
|
|
||||||
{
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.reset());
|
|
||||||
}
|
|
||||||
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(eastl::optional<Singleton<Log>::Lifetime> m_lifetime);
|
|
||||||
};
|
|
||||||
} // namespace Bigfoot
|
|
||||||
|
|
||||||
// This runs before main() and registers the environment
|
|
||||||
const ::testing::Environment* const kEnv = ::testing::AddGlobalTestEnvironment(new Bigfoot::TestingEnvironment());
|
|
||||||
19
Bigfoot/Tests/System/SystemTests/main.cpp
Normal file
19
Bigfoot/Tests/System/SystemTests/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/*********************************************************************
|
||||||
|
* \file main.cpp
|
||||||
|
*
|
||||||
|
* \author Romain BOULLARD
|
||||||
|
* \date May 2026
|
||||||
|
*********************************************************************/
|
||||||
|
#include <Utils/Log/LogMacros.hpp>
|
||||||
|
#include <Utils/TargetMacros.h>
|
||||||
|
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
testing::InitGoogleTest(&argc, argv);
|
||||||
|
|
||||||
|
BIGFOOT_NOT_OPTIMIZED_ONLY(::Bigfoot::Singleton<::Bigfoot::Log>::Lifetime m_lifetime);
|
||||||
|
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file Environment.cpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#include <Utils/Log/LogMacros.hpp>
|
|
||||||
#include <Utils/TargetMacros.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
namespace Bigfoot
|
|
||||||
{
|
|
||||||
class TestingEnvironment: public ::testing::Environment
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void SetUp() override
|
|
||||||
{
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.emplace());
|
|
||||||
}
|
|
||||||
|
|
||||||
void TearDown() override
|
|
||||||
{
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(m_lifetime.reset());
|
|
||||||
}
|
|
||||||
|
|
||||||
BIGFOOT_NOT_OPTIMIZED_ONLY(eastl::optional<Singleton<Log>::Lifetime> m_lifetime);
|
|
||||||
};
|
|
||||||
} // namespace Bigfoot
|
|
||||||
|
|
||||||
// This runs before main() and registers the environment
|
|
||||||
const ::testing::Environment* const kEnv = ::testing::AddGlobalTestEnvironment(new Bigfoot::TestingEnvironment());
|
|
||||||
19
Bigfoot/Tests/Utils/UtilsTests/main.cpp
Normal file
19
Bigfoot/Tests/Utils/UtilsTests/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/*********************************************************************
|
||||||
|
* \file main.cpp
|
||||||
|
*
|
||||||
|
* \author Romain BOULLARD
|
||||||
|
* \date May 2026
|
||||||
|
*********************************************************************/
|
||||||
|
#include <Utils/Log/LogMacros.hpp>
|
||||||
|
#include <Utils/TargetMacros.h>
|
||||||
|
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
testing::InitGoogleTest(&argc, argv);
|
||||||
|
|
||||||
|
BIGFOOT_NOT_OPTIMIZED_ONLY(::Bigfoot::Singleton<::Bigfoot::Log>::Lifetime m_lifetime);
|
||||||
|
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user