File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
RuntimeUnitTestToolkit/Assets/RuntimeUnitTestToolkit/Editor Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,21 @@ static void DisableAutoClose()
82
82
SaveSettings ( settings ) ;
83
83
}
84
84
85
+ [ MenuItem ( "Test/Settings/BuildScriptsOnly" , validate = true , priority = 6 ) ]
86
+ static bool ValidateBuildScriptsOnly ( )
87
+ {
88
+ Menu . SetChecked ( "Test/Settings/BuildScriptsOnly" , LoadOrGetDefaultSettings ( ) . BuildScriptsOnly ) ;
89
+ return true ;
90
+ }
91
+
92
+ [ MenuItem ( "Test/Settings/BuildScriptsOnly" , validate = false , priority = 6 ) ]
93
+ static void BuildScriptsOnly ( )
94
+ {
95
+ var settings = LoadOrGetDefaultSettings ( ) ;
96
+ settings . BuildScriptsOnly = ! settings . BuildScriptsOnly ;
97
+ SaveSettings ( settings ) ;
98
+ }
99
+
85
100
// generated
86
101
87
102
/*
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ internal class RuntimeUnitTestSettings
21
21
public bool Headless ;
22
22
public bool AutoRunPlayer ;
23
23
public bool DisableAutoClose ;
24
+ public bool BuildScriptsOnly ;
24
25
25
26
public RuntimeUnitTestSettings ( )
26
27
{
@@ -29,11 +30,12 @@ public RuntimeUnitTestSettings()
29
30
Headless = false ;
30
31
AutoRunPlayer = true ;
31
32
DisableAutoClose = false ;
33
+ BuildScriptsOnly = false ;
32
34
}
33
35
34
36
public override string ToString ( )
35
37
{
36
- return $ "{ ScriptBackend } { BuildTarget } Headless:{ Headless } AutoRunPlayer:{ AutoRunPlayer } DisableAutoClose:{ DisableAutoClose } ";
38
+ return $ "{ ScriptBackend } { BuildTarget } Headless:{ Headless } AutoRunPlayer:{ AutoRunPlayer } DisableAutoClose:{ DisableAutoClose } BuildScriptsonly: { BuildScriptsOnly } ";
37
39
}
38
40
}
39
41
@@ -390,11 +392,15 @@ public static UnitTestRunner BuildUnitTestRunnerScene()
390
392
391
393
static void Build ( string sceneName , string buildPath , RuntimeUnitTestSettings settings )
392
394
{
393
- var options = BuildOptions . BuildScriptsOnly | BuildOptions . IncludeTestAssemblies ;
395
+ var options = BuildOptions . IncludeTestAssemblies ;
394
396
if ( settings . AutoRunPlayer )
395
397
{
396
398
options |= BuildOptions . AutoRunPlayer ;
397
399
}
400
+ if ( settings . BuildScriptsOnly )
401
+ {
402
+ options |= BuildOptions . BuildScriptsOnly ;
403
+ }
398
404
#if ! UNITY_2021_2_OR_NEWER
399
405
if ( settings . Headless )
400
406
{
You can’t perform that action at this time.
0 commit comments