5 description:
"Runs the test suite or test case the cursor currently is in.\nSupports only SCR_Autotest* suites.",
7 wbModules: {
"ScriptEditor" },
9 awesomeFontCode: 0xF188
11class SCR_AutotestPlugin : WorkbenchPlugin
13 [
Attribute(defvalue:
"1",
desc:
"Focus world editor when starting the run")]
14 bool m_bFocusWorldEditor;
16 [
Attribute(defvalue:
"1",
desc:
"Open result dialog after the test run")]
17 bool m_bOpenDialogAfterRun;
19 [
Attribute(defvalue:
"0",
desc:
"Open the autotest.log after the test run")]
20 bool m_bOpenLogAfterRun;
22 [
Attribute(defvalue:
"0",
desc:
"Output all logs for successful tests in autotest.log")]
25 [
Attribute(defvalue:
"1",
desc:
"Close the game after test runner has finished")]
26 bool m_bCloseGameAfterRun;
28#ifndef AUTOTEST_DISABLE_RUN_SCRIPT_EDITOR
33 static bool GetCursorClassAndMethodNames(out
string className, out
string methodName)
35 ScriptEditor scriptEditor = Workbench.GetModule(ScriptEditor);
36 return SCR_CopyClassAndMethodPlugin.GetCursorClassAndMethodNames(scriptEditor, className, methodName);
42 string className, methodName;
43 if (!GetCursorClassAndMethodNames(className, methodName))
45 Print(
"The current line is not inside of a class.",
LogLevel.WARNING);
49 if (m_bFocusWorldEditor)
54 RunClassName(className.Trim());
62 Workbench.ScriptDialog(
"Autotest Plugin Configuration",
"",
this);
80 void RunClassName(
string className,
bool gui =
false)
84 RunTestSuite(className);
90 RunTestCase(className, gui);
94 PrintFormat(
"Current line is not inside of a test suite or test case: \"%1\"", className, level:
LogLevel.WARNING);
97 string msg =
string.Format(
"\"%1\" is not a test suite or test case class.", className);
98 Workbench.Dialog(
"Invalid class", msg);
103 protected void RunTestSuite(
string testSuiteClass)
116 protected void RunTestCase(
string testCaseClass,
bool gui)
138 [
Friend(SCR_AutotestTool)]
139 protected void FocusWorldEditor()
141 WorldEditor worldEditor = Workbench.GetModule(WorldEditor);
143 worldEditor.GetPlugin(SCR_AutotestTool);
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Collection of test suites.
static void Begin(SCR_AutotestGroup testGroup, bool autorun=false, bool verboseLog=false)
Configures the test runner to execute only the test suites present in the specified test group and in...
static bool s_bOpenDialogAfterRun
static bool s_bOpenLogAfterRun
static bool s_bCloseGameAfterRun
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute