Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AutotestSuiteBase.c
Go to the documentation of this file.
1
6
[
BaseContainerProps
(
category
:
"Autotest"
)]
7
class
SCR_AutotestSuiteBase
:
TestSuite
8
{
9
//------------------------------------------------------------------------------------------------
11
ResourceName
GetWorldFile()
12
{
13
return
SCR_AutotestHelper
.GetDefaultWorld();
14
}
15
16
//------------------------------------------------------------------------------------------------
18
ResourceName
GetWorldSystemsConfigFile()
19
{
20
return
SCR_AutotestHelper
.GetDefaultSystemsConfig();
21
}
22
23
//------------------------------------------------------------------------------------------------
27
void
Print(
string
msg,
LogLevel
level =
LogLevel
.NORMAL)
28
{
29
SCR_AutotestHarness
.GetLogger().
Log
(msg, level);
30
}
31
32
//------------------------------------------------------------------------------------------------
36
void
PrintFormat(
string
fmt,
string
param1
=
""
,
string
param2
=
""
,
string
param3
=
""
,
LogLevel
level =
LogLevel
.NORMAL)
37
{
38
SCR_AutotestHarness
.GetLogger().
Log
(
string
.Format(fmt,
param1
,
param2
,
param3
), level);
39
}
40
41
//------------------------------------------------------------------------------------------------
43
[
Step
(
EStage
.Setup)]
44
private
void
Setup_PrintPrelude()
45
{
46
SCR_AutotestHarness
.GetLogger().
PrintTestSuitePrelude
(
this
);
47
}
48
49
//------------------------------------------------------------------------------------------------
51
[
Step
(
EStage
.Setup)]
52
private
void
Setup_OpenWorld()
53
{
54
ResourceName
world = GetWorldFile();
55
ResourceName
systemsConfig = GetWorldSystemsConfigFile();
56
if
(world && !
SCR_AutotestHelper
.WorldOpenFile(world, systemsConfig))
57
{
58
string
failure =
string
.Format(
"Failed to load world: %1, %2"
, world, systemsConfig);
59
SCR_AutotestHarness
.GetLogger().
Log
(failure, level:
LogLevel
.ERROR);
60
61
SetResult(
SCR_AutotestResult
.
AsFailure
(failure));
62
}
63
}
64
65
//------------------------------------------------------------------------------------------------
67
[
Step
(
EStage
.Setup)]
68
private
bool
Setup_AwaitWorld()
69
{
70
return
!
GameStateTransitions
.IsTransitionRequestedOrInProgress();
71
}
72
73
//------------------------------------------------------------------------------------------------
75
[
Step
(
EStage
.Setup)]
76
private
void
Setup_CloseMenus()
77
{
78
GetGame
().GetMenuManager().CloseAllMenus();
79
}
80
81
//------------------------------------------------------------------------------------------------
83
[
Step
(
EStage
.TearDown)]
84
private
void
TearDown_PrintEpilogue()
85
{
86
SCR_AutotestHarness
.GetLogger().
PrintTestSuiteEpilogue
(
this
);
87
}
88
}
89
90
#ifdef MODULE_AUTOTEST
91
// HACK: prevents script compilation from sealing methods by overriding them in any class
92
// fixes the issue with not being able to override these methods in different script modules (Autotest/)
93
sealed
class
SCR_Hack_AutotestSuiteBase :
SCR_AutotestSuiteBase
94
{
95
override
ResourceName
GetWorldFile();
96
override
ResourceName
GetWorldSystemsConfigFile();
97
}
98
#endif
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
GameStateTransitions
Definition
GameStateTransitions.c:13
ResourceName
Definition
ResourceName.c:13
SCR_AutotestHarness
Definition
SCR_AutotestHarness.c:24
SCR_AutotestHelper
Definition
SCR_AutotestHelper.c:4
SCR_AutotestPrinter::PrintTestSuiteEpilogue
void PrintTestSuiteEpilogue(TestSuite suite)
Definition
SCR_AutotestPrinter.c:28
SCR_AutotestPrinter::Log
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.
Definition
SCR_AutotestPrinter.c:36
SCR_AutotestPrinter::PrintTestSuitePrelude
void PrintTestSuitePrelude(TestSuite suite)
Definition
SCR_AutotestPrinter.c:20
SCR_AutotestResult
Definition
SCR_AutotestResult.c:5
SCR_AutotestResult::AsFailure
static SCR_AutotestResult AsFailure(string reason, string param1="", string param2="", string param3="")
Definition
SCR_AutotestResult.c:25
SCR_AutotestSuiteBase
Definition
SCR_AutotestSuiteBase.c:8
TestSuite
Collection of tests. Provides API for environment preparation.
Definition
TestSuite.c:14
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Step
class TestStep Step
EStage
class Test EStage
param3
T3 param3
Definition
tuple.c:93
param2
T2 param2
Definition
tuple.c:92
param1
Tuple param1
scripts
Autotest
Game
TestFramework
SCR_AutotestSuiteBase.c
Generated by
1.17.0