class in UnityEditor.TestTools
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloseMark a test or test fixture as requiring that particular platform support has been installed into Unity.
This attribute can be used in Editor tests to indicate that the test requires support for particular platforms to have been installed. If the required support is not available, the test will be skipped.
For example, tests that use the BuildPipeline API to build a player for iOS may wish to use this attribute to indicate that they require iOS support to be installed, avoiding test failures when the tests are run on a machine without iOS support installed.
using UnityEditor; using UnityEditor.TestTools; using NUnit.Framework;
public class MyBuildTests { [Test] [RequirePlatformSupport(BuildTarget.StandaloneWindows64)] public void CanBuildForWin64Bit() { var result = BuildPipeline.BuildPlayer(EditorBuildSettings.scenes, System.IO.Path.GetTempFileName(), BuildTarget.StandaloneWindows64, BuildOptions.None); Assert.Equals("", result); } }
platforms | The list of platforms required by the test or test fixture marked with this attribute. |
RequirePlatformSupportAttribute | Specifies that the test or test fixture requires particular platform support to be installed. See RequirePlatformSupportAttribute. |