Skip to content

Commit 3e9b623

Browse files
authored
Merge pull request #157 from MenelvagorMilsom/feature/add-runtests-flag
Add runTests flag to Start-UnityEditor
2 parents 46027e3 + ede42af commit 3e9b623

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,12 @@ function Get-UnityProjectInstance {
776776
Where to put the results? Unity states, "If the path is a folder, the command line uses a default file name. If not specified, it places the results in the project’s root folder."
777777
.PARAMETER RunEditorTests
778778
Should Unity run the editor tests? Unity states, "[...]it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished."
779+
.PARAMETER TestPlatform
780+
The platform you want to run the tests on. Note that If unspecified, tests run in editmode by default.
781+
.PARAMETER TestResults
782+
The path indicating where Unity should save the result file. By default, Unity saves it in the Project’s root folder.
783+
.PARAMETER RunTests
784+
Should Unity run tests? Unity states, "[...]it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished."
779785
.PARAMETER BatchMode
780786
Should the Unity Editor start in batch mode?
781787
.PARAMETER Quit
@@ -850,6 +856,13 @@ function Start-UnityEditor {
850856
[parameter(Mandatory = $false)]
851857
[switch]$RunEditorTests,
852858
[parameter(Mandatory = $false)]
859+
[ValidateSet('EditMode', 'PlayMode')]
860+
[string]$TestPlatform,
861+
[parameter(Mandatory = $false)]
862+
[string]$TestResults,
863+
[parameter(Mandatory = $false)]
864+
[switch]$RunTests,
865+
[parameter(Mandatory = $false)]
853866
[switch]$BatchMode,
854867
[parameter(Mandatory = $false)]
855868
[switch]$Quit,
@@ -945,6 +958,9 @@ function Start-UnityEditor {
945958
if ( $EditorTestsFilter ) { $sharedArgs += '-editorTestsFilter', ($EditorTestsFilter -join ',') }
946959
if ( $EditorTestsResultFile ) { $sharedArgs += '-editorTestsResultFile', $EditorTestsResultFile }
947960
if ( $RunEditorTests ) { $sharedArgs += '-runEditorTests' }
961+
if ( $TestPlatform ) { $sharedArgs += '-testPlatform', $TestPlatform }
962+
if ( $TestResults ) { $sharedArgs += '-testResults', $TestResults }
963+
if ( $RunTests ) { $sharedArgs += '-runTests' }
948964
if ( $ForceFree) { $sharedArgs += '-force-free' }
949965

950966
$instanceArgs = @()

0 commit comments

Comments
 (0)