Unity Test Framework adds the following additional arguments to the regular Unity Editor command-line arguments:
Command | Description |
---|---|
-assemblyNames |
A semicolon-separated list of test assemblies to include in the run. A semi-colon separated list should be formatted as a string enclosed in quotation marks, e.g. -assemblyNames "firstAssembly;secondAssembly" . |
-forgetProjectPath |
Prevents Unity saving your current project into the Unity launcher/hub history. |
-orderedTestListFile |
Path to a .txt file which contains a list of full test names you want to run in the specified order. There are no restrictions on the file name as long as the format is text. Separate tests by new lines and specify parameters if the tests have them. The following is an example of the content of such a file:Unity.Framework.Tests.OrderedTests.NoParameters Unity.Framework.Tests.OrderedTests.ParametrizedTestA(3,2) Unity.Framework.Tests.OrderedTests.ParametrizedTestB("Assets/file.fbx") Unity.Framework.Tests.OrderedTests.ParametrizedTestD(1.0f) Unity.Framework.Tests.OrderedTests.ParametrizedTestE(null) Unity.Framework.Tests.OrderedTests.ParametrizedTestF(False, 1) Unity.Framework.Tests.OrderedTests.ParametrizedTestG(float.NaN) Unity.Framework.Tests.OrderedTests.ParametrizedTestH(SomeEnum)
|
-playerHeartbeatTimeout |
Defines the length of time, in seconds, for which the Editor waits for heartbeats after starting a test run on a Player. This defaults to 10 minutes. |
-randomOrderSeed |
A non-zero integer representing the seed value to use for randomizing tests in the project, independently from the fixture.# normal order Test_1 Test_2 Test_3 Test_4 # randomized with seed x Test_3 Test_1 Test_4 Test_2 # randomized with same seed x and a new test Test_3 Test_5 Test_1 Test_4 Test_2
|
-repeat |
An integer that sets the repeat count. Successful tests are repeated up to this number of times, or until they fail, whichever happens first. |
-retry |
An integer that sets the retry count. Failing tests are retried up to this number of times, or until they succeed, whichever happens first. |
-runSynchronously |
Supply this argument to run tests synchronously, guaranteeing that all tests run in one Editor update call. This is only supported for Edit mode tests. Tests that take multiple frames, such as [UnityTest] tests, or tests with [UnitySetUp] or [UnityTearDown] scaffolding, are filtered out. |
-runTests |
Runs tests in the Project. |
-testCategory |
A semicolon-separated list of test categories to include in the run, or a regular expression pattern to match category names. A semi-colon separated list should be formatted as a string enclosed in quotation marks, for example -testCategory "firstCategory;secondCategory" . If both -testFilter and -testCategory are provided, only tests that match both are run. This argument supports negation using ! . Using !MyCategory excludes tests with the MyCategory category from the run. |
-testfilter |
A semicolon-separated list of test names to run, or a regular expression pattern to match tests by their full name. A semi-colon separated list should be formatted as a string enclosed in quotation marks, for example testFilter "Low;Medium" . This argument supports negation using ! . The test filter !MyNamespace.Something.MyTest runs all tests except the one called MyNamespace.Something.MyTest . Run a specific variation of a parameterized test as follows: "ClassName\.MethodName\(Param1,Param2\)"
|
-testPlatform |
The platform to run tests on. Accepted values:
|
-testResults |
Specifies a path to which Unity saves the test result file. By default, Unity saves the file in the project’s root folder. Test results follow the XML format as defined by NUnit, for more information refer to Test Result XML Format. There is currently no common definition for exit codes reported by individual Unity components under test. The best way to understand the source of a problem is the content of error messages and stack traces. |
-testSettingsFile |
Path to a TestSettings.json file. |
Note: The Editor’s regular -quit
command-line argument is not supported while tests are running.
You can define options for a test run in a TestSettings.json
file. You can specify the location of this file using the -testSettingsFile
command line argument.
The following example illustrates the content of a typical TestSettings.json
file:
{
"scriptingBackend":"WinRTDotNET",
"Architecture":null,
"apiProfile":0,
"featureFlags": { "requiresSplashScreen": true }
}
The following table lists the valid options and values for a TestSettings.json
file:
Option | Description |
---|---|
apiProfile |
The .NET API compatability level. Set to one of the following values:
|
appleEnableAutomaticSigning |
Enables automatic signing of Apple devices. For more information, refer to PlayerSettings.iOS.appleEnableAutomaticSigning. |
appleDeveloperTeamID |
Sets the team ID for the apple developer account. For more information, refer to PlayerSettings.iOS.appleDeveloperTeamID. |
architecture |
Target Android architecture. Set to one of the following values:
|
iOSManualProvisioningProfileType |
For more information, refer to PlayerSettings.iOS.iOSManualProvisioningProfileType. Set to one of the following values:
|
iOSTargetSDK |
Target SDK for iOS. Set to one of the following values, which should be given as a string literal enclosed in quotes:
|
tvOSManualProvisioningProfileType |
For more information, refer to PlayerSettings.iOS.tvOSManualProvisioningProfileType. Set to one of the following values:
|
tvOSTargetSDK |
Target SDK for tvOS. Set to one of the following values, which should be given as a string literal enclosed in quotes:
|
scriptingBackend |
Set to one of the following values, which should be given as a string literal enclosed in quotes:
|
playerGraphicsAPI |
Set graphics API that will be used during test execution in the player. Value can be any GraphicsDeviceType as a string literal enclosed in quotes. Value will only be set if it is supported on the target platform. |
webGLClientBrowserType |
A browser to be used when running test using WebGL platform. Accepted browser types:
|
webGLClientBrowserPath |
An absolute path to the browser’s location on your device. If not defined, path from UNITY_AUTOMATION_DEFAULT_BROWSER_PATH enviromental variable will be used. |
androidBuildAppBundle |
A boolean setting that allows to build an Android App Bundle (AAB) instead of APKThe Android Package format output by Unity. An APK is automatically deployed to your device when you select File > Build & Run. More info See in Glossary for tests. |
featureFlags |
Map of strings and boolean values which can switch Unity Test Framework features on or off. The currently supported features are:
|
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.