Bigfoot / Sonarqube (push) Skipped
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Failing after 21s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Failing after 26s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Failing after 26s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Failing after 17s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Failing after 26s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Failing after 19s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Failing after 27s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Failing after 28s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Failing after 24s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Failing after 29s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Failing after 26s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Failing after 30s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Failing after 30s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Failing after 35s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Canceled after 0s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Canceled after 0s
Bigfoot / Clang Format Checks (push) Canceled after 0s
Bigfoot / Sonarqube (pull_request) Canceled after 0s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Canceled after 13s
87 lines
2.4 KiB
C++
87 lines
2.4 KiB
C++
/*********************************************************************
|
|
* \file LogMacros.cpp
|
|
*
|
|
* \author Romain BOULLARD
|
|
* \date May 2026
|
|
*********************************************************************/
|
|
#include <Utils/Log/LogMacros.hpp>
|
|
|
|
#include <Utils/Singleton.hpp>
|
|
|
|
#include <UtilsTests/UtilsTestsLogger_generated.hpp>
|
|
|
|
#ifdef BIGFOOT_NOT_OPTIMIZED
|
|
|
|
#include <gmock/gmock.h>
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <fstream>
|
|
#include <sstream>
|
|
#include <string>
|
|
|
|
namespace Bigfoot
|
|
{
|
|
class LogMacrosFixture: public ::testing::Test
|
|
{
|
|
protected:
|
|
static std::string ReadFileSinkContent()
|
|
{
|
|
Singleton<Log>::GetInstance().Flush();
|
|
|
|
std::ifstream file {std::string {Log::FILE_SINK_PATH.data()}};
|
|
std::stringstream buffer;
|
|
buffer << file.rdbuf();
|
|
return buffer.str();
|
|
}
|
|
};
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(LogMacrosFixture, LogDebug)
|
|
{
|
|
BIGFOOT_LOG_DEBUG(UTILSTESTS_LOGGER, "Hello Debug");
|
|
EXPECT_THAT(ReadFileSinkContent(), ::testing::HasSubstr("Hello Debug"));
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(LogMacrosFixture, LogTrace)
|
|
{
|
|
BIGFOOT_LOG_TRACE(UTILSTESTS_LOGGER, "Hello Trace");
|
|
EXPECT_THAT(ReadFileSinkContent(), ::testing::HasSubstr("Hello Trace"));
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(LogMacrosFixture, LogInfo)
|
|
{
|
|
BIGFOOT_LOG_INFO(UTILSTESTS_LOGGER, "Hello Info");
|
|
EXPECT_THAT(ReadFileSinkContent(), ::testing::HasSubstr("Hello Info"));
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(LogMacrosFixture, LogWarn)
|
|
{
|
|
BIGFOOT_LOG_WARN(UTILSTESTS_LOGGER, "Hello Warn");
|
|
EXPECT_THAT(ReadFileSinkContent(), ::testing::HasSubstr("Hello Warn"));
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(LogMacrosFixture, LogError)
|
|
{
|
|
BIGFOOT_LOG_ERROR(UTILSTESTS_LOGGER, "Hello Error");
|
|
EXPECT_THAT(ReadFileSinkContent(), ::testing::HasSubstr("Hello Error"));
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(LogMacrosFixture, LogFatal)
|
|
{
|
|
BIGFOOT_LOG_FATAL(UTILSTESTS_LOGGER, "Hello Fatal");
|
|
EXPECT_THAT(ReadFileSinkContent(), ::testing::HasSubstr("Hello Fatal"));
|
|
}
|
|
} // namespace Bigfoot
|
|
#endif
|