gem5 v24.0.0.0
Loading...
Searching...
No Matches
logging.test.cc File Reference
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "base/gtest/logging.hh"
#include "base/logging.hh"

Go to the source code of this file.

Classes

class  LoggingFixture
 Temporarily redirects cerr to gtestLogOutput. More...
 

Functions

 TEST_F (LoggingFixture, BasicPrint)
 Test the most basic print.
 
 TEST_F (LoggingFixture, VariadicCharPrint)
 Test the variadic-arg print for chars.
 
 TEST_F (LoggingFixture, VariadicStringPrint)
 Test the variadic-arg print for strings.
 
 TEST_F (LoggingFixture, VariadicCharMissingPrint)
 Test the variadic-arg print for chars with arguments missing.
 
 TEST_F (LoggingFixture, VariadicStringMissingPrint)
 Test the variadic-arg print for strings with arguments missing.
 
 TEST_F (LoggingFixture, DisabledPrint)
 Test that no message is shown when printing with a disabled logger.
 
 TEST_F (LoggingFixture, WarnLoggerPrint)
 Test printing with the warn logger, enabled and disabled.
 
 TEST_F (LoggingFixture, InfoLoggerPrint)
 Test printing with the info logger, enabled and disabled.
 
 TEST_F (LoggingFixture, HackLoggerPrint)
 Test printing with the hack logger, enabled and disabled.
 
 TEST_F (LoggingFixture, FatalLoggerPrint)
 Test printing with the fatal logger, enabled and disabled.
 
 TEST_F (LoggingFixture, PanicLoggerPrint)
 Test printing with the panic logger, which cannot be disabled.
 
 TEST_F (LoggingFixture, BaseMessage)
 Test macro base_message.
 
 TEST_F (LoggingFixture, BaseMessageOnce)
 Test that base_message_once only prints the message once in a loop.
 
 TEST_F (LoggingFixture, Warn)
 Test macro warn.
 
 TEST_F (LoggingFixture, Inform)
 Test macro inform.
 
 TEST_F (LoggingFixture, Hack)
 Test macro hack.
 
 TEST_F (LoggingFixture, WarnOnce)
 Test that warn_once only prints the message once in a loop.
 
 TEST_F (LoggingFixture, InformOnce)
 Test that inform_once only prints the message once in a loop.
 
 TEST_F (LoggingFixture, HackOnce)
 Test that hack_once only prints the message once in a loop.
 
 TEST_F (LoggingFixture, WarnIf)
 Test that warn_if only prints the message when the condition is true.
 
 TEST_F (LoggingFixture, WarnIfOnce)
 Test that warn_if_once only prints the message once in a loop.
 
 TEST (LoggingDeathTest, EmptyPrefix)
 Test that a logger cannot be created with an empty prefix.
 
 TEST (LoggingDeathTest, ExitHelper)
 Test that the test logger's exit helper will end execution gracefully.
 
 TEST (LoggingDeathTest, WarnLoggerExitHelper)
 Test that the warn logger's exit helper will end execution gracefully.
 
 TEST (LoggingDeathTest, InfoLoggerExitHelper)
 Test that the info logger's exit helper will end execution gracefully.
 
 TEST (LoggingDeathTest, HackLoggerExitHelper)
 Test that the hack logger's exit helper will end execution gracefully.
 
 TEST (LoggingDeathTest, FatalLoggerExitHelper)
 Test that the fatal logger's exit helper will end execution with error.
 
 TEST (LoggingDeathTest, PanicLoggerExitHelper)
 Test that the panic logger's exit helper will end execution with error.
 
 TEST (LoggingDeathTest, ExitMessage)
 Test that exit_message prints a message and exits.
 
 TEST (LoggingDeathTest, Panic)
 Test macro panic.
 
 TEST (LoggingDeathTest, Fatal)
 Test macro fatal.
 
 TEST (LoggingDeathTest, PanicIf)
 Test that panic_if only prints the message when the condition is true.
 
 TEST (LoggingDeathTest, FatalIf)
 Test that fatal_if only prints the message when the condition is true.
 
 TEST (LoggingDeathTest, gem5Assert)
 Test macro gem5_assert.
 

Function Documentation

◆ TEST() [1/13]

TEST ( LoggingDeathTest ,
EmptyPrefix  )

Test that a logger cannot be created with an empty prefix.

Definition at line 464 of file logging.test.cc.

◆ TEST() [2/13]

TEST ( LoggingDeathTest ,
ExitHelper  )

Test that the test logger's exit helper will end execution gracefully.

Definition at line 474 of file logging.test.cc.

◆ TEST() [3/13]

TEST ( LoggingDeathTest ,
ExitMessage  )

Test that exit_message prints a message and exits.

Definition at line 510 of file logging.test.cc.

References exit_message.

◆ TEST() [4/13]

TEST ( LoggingDeathTest ,
Fatal  )

Test macro fatal.

Definition at line 524 of file logging.test.cc.

References fatal.

◆ TEST() [5/13]

TEST ( LoggingDeathTest ,
FatalIf  )

Test that fatal_if only prints the message when the condition is true.

Definition at line 539 of file logging.test.cc.

References fatal_if.

◆ TEST() [6/13]

TEST ( LoggingDeathTest ,
FatalLoggerExitHelper  )

Test that the fatal logger's exit helper will end execution with error.

Definition at line 498 of file logging.test.cc.

References gem5::Logger::getFatal().

◆ TEST() [7/13]

TEST ( LoggingDeathTest ,
gem5Assert  )

Test macro gem5_assert.

Definition at line 547 of file logging.test.cc.

References gem5_assert.

◆ TEST() [8/13]

TEST ( LoggingDeathTest ,
HackLoggerExitHelper  )

Test that the hack logger's exit helper will end execution gracefully.

Definition at line 492 of file logging.test.cc.

References gem5::Logger::getHack().

◆ TEST() [9/13]

TEST ( LoggingDeathTest ,
InfoLoggerExitHelper  )

Test that the info logger's exit helper will end execution gracefully.

Definition at line 486 of file logging.test.cc.

References gem5::Logger::getInfo().

◆ TEST() [10/13]

TEST ( LoggingDeathTest ,
Panic  )

Test macro panic.

Definition at line 517 of file logging.test.cc.

References panic.

◆ TEST() [11/13]

TEST ( LoggingDeathTest ,
PanicIf  )

Test that panic_if only prints the message when the condition is true.

Definition at line 531 of file logging.test.cc.

References panic_if.

◆ TEST() [12/13]

TEST ( LoggingDeathTest ,
PanicLoggerExitHelper  )

Test that the panic logger's exit helper will end execution with error.

Definition at line 504 of file logging.test.cc.

References gem5::Logger::getPanic().

◆ TEST() [13/13]

TEST ( LoggingDeathTest ,
WarnLoggerExitHelper  )

Test that the warn logger's exit helper will end execution gracefully.

Definition at line 480 of file logging.test.cc.

References gem5::Logger::getWarn().

◆ TEST_F() [1/21]

TEST_F ( LoggingFixture ,
BaseMessage  )

Test macro base_message.

Definition at line 250 of file logging.test.cc.

References base_message, and gem5::gtestLogOutput.

◆ TEST_F() [2/21]

TEST_F ( LoggingFixture ,
BaseMessageOnce  )

Test that base_message_once only prints the message once in a loop.

Definition at line 281 of file logging.test.cc.

References base_message_once, gem5::gtestLogOutput, and gem5::ArmISA::i.

◆ TEST_F() [3/21]

TEST_F ( LoggingFixture ,
BasicPrint  )

Test the most basic print.

Definition at line 50 of file logging.test.cc.

References gem5::gtestLogOutput, and gem5::Logger::print().

◆ TEST_F() [4/21]

TEST_F ( LoggingFixture ,
DisabledPrint  )

Test that no message is shown when printing with a disabled logger.

Definition at line 143 of file logging.test.cc.

References gem5::statistics::enabled(), gem5::gtestLogOutput, and gem5::Logger::Logger().

◆ TEST_F() [5/21]

TEST_F ( LoggingFixture ,
FatalLoggerPrint  )

Test printing with the fatal logger, enabled and disabled.

Definition at line 215 of file logging.test.cc.

References gem5::Logger::FATAL, gem5::Logger::getFatal(), gem5::gtestLogOutput, gem5::Logger::NUM_LOG_LEVELS, gem5::Logger::PANIC, gem5::Logger::print(), and gem5::Logger::setLevel().

◆ TEST_F() [6/21]

TEST_F ( LoggingFixture ,
Hack  )

Test macro hack.

Definition at line 360 of file logging.test.cc.

References gem5::gtestLogOutput, and hack.

◆ TEST_F() [7/21]

TEST_F ( LoggingFixture ,
HackLoggerPrint  )

Test printing with the hack logger, enabled and disabled.

Definition at line 197 of file logging.test.cc.

References gem5::Logger::getHack(), gem5::gtestLogOutput, gem5::Logger::HACK, gem5::Logger::NUM_LOG_LEVELS, gem5::Logger::PANIC, gem5::Logger::print(), and gem5::Logger::setLevel().

◆ TEST_F() [8/21]

TEST_F ( LoggingFixture ,
HackOnce  )

Test that hack_once only prints the message once in a loop.

Definition at line 421 of file logging.test.cc.

References gem5::gtestLogOutput, hack_once, and gem5::ArmISA::i.

◆ TEST_F() [9/21]

TEST_F ( LoggingFixture ,
InfoLoggerPrint  )

Test printing with the info logger, enabled and disabled.

Definition at line 179 of file logging.test.cc.

References gem5::Logger::getInfo(), gem5::gtestLogOutput, gem5::Logger::INFO, gem5::Logger::NUM_LOG_LEVELS, gem5::Logger::PANIC, gem5::Logger::print(), and gem5::Logger::setLevel().

◆ TEST_F() [10/21]

TEST_F ( LoggingFixture ,
Inform  )

Test macro inform.

Definition at line 329 of file logging.test.cc.

References gem5::gtestLogOutput, and inform.

◆ TEST_F() [11/21]

TEST_F ( LoggingFixture ,
InformOnce  )

Test that inform_once only prints the message once in a loop.

Definition at line 406 of file logging.test.cc.

References gem5::gtestLogOutput, gem5::ArmISA::i, and inform_once.

◆ TEST_F() [12/21]

TEST_F ( LoggingFixture ,
PanicLoggerPrint  )

Test printing with the panic logger, which cannot be disabled.

Definition at line 236 of file logging.test.cc.

References gem5::Logger::getPanic(), gem5::gtestLogOutput, gem5::Logger::NUM_LOG_LEVELS, gem5::Logger::PANIC, gem5::Logger::print(), and gem5::Logger::setLevel().

◆ TEST_F() [13/21]

TEST_F ( LoggingFixture ,
VariadicCharMissingPrint  )

Test the variadic-arg print for chars with arguments missing.

Definition at line 111 of file logging.test.cc.

References gem5::gtestLogOutput, and gem5::Logger::print().

◆ TEST_F() [14/21]

TEST_F ( LoggingFixture ,
VariadicCharPrint  )

Test the variadic-arg print for chars.

Definition at line 78 of file logging.test.cc.

References gem5::gtestLogOutput, and gem5::Logger::print().

◆ TEST_F() [15/21]

TEST_F ( LoggingFixture ,
VariadicStringMissingPrint  )

Test the variadic-arg print for strings with arguments missing.

Definition at line 127 of file logging.test.cc.

References gem5::gtestLogOutput, and gem5::Logger::print().

◆ TEST_F() [16/21]

TEST_F ( LoggingFixture ,
VariadicStringPrint  )

Test the variadic-arg print for strings.

Definition at line 95 of file logging.test.cc.

References gem5::gtestLogOutput, and gem5::Logger::print().

◆ TEST_F() [17/21]

TEST_F ( LoggingFixture ,
Warn  )

Test macro warn.

Definition at line 298 of file logging.test.cc.

References gem5::gtestLogOutput, and warn.

◆ TEST_F() [18/21]

TEST_F ( LoggingFixture ,
WarnIf  )

Test that warn_if only prints the message when the condition is true.

Definition at line 436 of file logging.test.cc.

References gem5::gtestLogOutput, and warn_if.

◆ TEST_F() [19/21]

TEST_F ( LoggingFixture ,
WarnIfOnce  )

Test that warn_if_once only prints the message once in a loop.

Definition at line 449 of file logging.test.cc.

References gem5::gtestLogOutput, gem5::ArmISA::i, and warn_if_once.

◆ TEST_F() [20/21]

TEST_F ( LoggingFixture ,
WarnLoggerPrint  )

Test printing with the warn logger, enabled and disabled.

Definition at line 161 of file logging.test.cc.

References gem5::Logger::getWarn(), gem5::gtestLogOutput, gem5::Logger::NUM_LOG_LEVELS, gem5::Logger::PANIC, gem5::Logger::print(), gem5::Logger::setLevel(), and gem5::Logger::WARN.

◆ TEST_F() [21/21]

TEST_F ( LoggingFixture ,
WarnOnce  )

Test that warn_once only prints the message once in a loop.

Definition at line 391 of file logging.test.cc.

References gem5::gtestLogOutput, gem5::ArmISA::i, and warn_once.


Generated on Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0