Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_AutotestPrinter Interface Reference

Specialized logging class for tests. More...

Public Member Functions

void PrintTestSuitePrelude (TestSuite suite)
 
void PrintTestSuiteEpilogue (TestSuite suite)
 
void Log (string msg, LogLevel level=LogLevel.NORMAL, bool forceFileWrite=false, bool consoleLog=true)
 Should be used in tests instead of global Print. Forwards test output to separate file.
 
void LogOnce (string msg, LogLevel level=LogLevel.NORMAL)
 Prevents duplicate printing of the same message. Intended to be used with messages printed many times a second.
 
void LogTestCaseResult (TestBase test)
 Writes test result to console and autotest log files.
 
void SCR_AutotestPrinter (bool verbose)
 
void ~SCR_AutotestPrinter ()
 

Static Public Attributes

static const string LOG_PATH = "$logs:autotest.log"
 
static const int LOG_ONCE_THRESHOLD = 10000
 

Protected Attributes

bool m_bLogVerbose
 
ref FileHandle m_LogFile
 
ref map< TypeName, ref array< string > > m_mLogBuffer = new map<TypeName, ref array<string>>()
 
string m_sLogOnceLastMsg
 
int m_iLogOnceLastMsgCount
 

Detailed Description

Specialized logging class for tests.

Outputs logs to console and also buffers them for later output to autotest log file. Should be used instead of Print and PrintFormat inside the SCR_AutotestSuite and SCR_AutotestCase classes.

Constructor & Destructor Documentation

◆ SCR_AutotestPrinter()

void SCR_AutotestPrinter.SCR_AutotestPrinter ( bool verbose)

◆ ~SCR_AutotestPrinter()

void SCR_AutotestPrinter.~SCR_AutotestPrinter ( )

Member Function Documentation

◆ Log()

void SCR_AutotestPrinter.Log ( string msg,
LogLevel level = LogLevel::NORMAL,
bool forceFileWrite = false,
bool consoleLog = true )

Should be used in tests instead of global Print. Forwards test output to separate file.

◆ LogOnce()

void SCR_AutotestPrinter.LogOnce ( string msg,
LogLevel level = LogLevel::NORMAL )

Prevents duplicate printing of the same message. Intended to be used with messages printed many times a second.

◆ LogTestCaseResult()

void SCR_AutotestPrinter.LogTestCaseResult ( TestBase test)

Writes test result to console and autotest log files.

If test is failed or verbose logging is enabled will additionaly print test log output for debugging.

◆ PrintTestSuiteEpilogue()

void SCR_AutotestPrinter.PrintTestSuiteEpilogue ( TestSuite suite)

◆ PrintTestSuitePrelude()

void SCR_AutotestPrinter.PrintTestSuitePrelude ( TestSuite suite)

Member Data Documentation

◆ LOG_ONCE_THRESHOLD

const int SCR_AutotestPrinter.LOG_ONCE_THRESHOLD = 10000
static

◆ LOG_PATH

const string SCR_AutotestPrinter.LOG_PATH = "$logs:autotest.log"
static

◆ m_bLogVerbose

bool SCR_AutotestPrinter.m_bLogVerbose
protected

◆ m_iLogOnceLastMsgCount

int SCR_AutotestPrinter.m_iLogOnceLastMsgCount
protected

◆ m_LogFile

ref FileHandle SCR_AutotestPrinter.m_LogFile
protected

◆ m_mLogBuffer

ref map<TypeName, ref array<string> > SCR_AutotestPrinter.m_mLogBuffer = new map<TypeName, ref array<string>>()
protected

◆ m_sLogOnceLastMsg

string SCR_AutotestPrinter.m_sLogOnceLastMsg
protected

The documentation for this interface was generated from the following file: