docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VerifyRunConfigurationAttribute

    Stops a test when the run doesn't render the way its command line asks, so the test doesn't report results for a configuration that nobody asked for.

    Inheritance
    object
    Attribute
    VerifyRunConfigurationAttribute
    Implements
    ITestAction
    Inherited Members
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.TestTools.Graphics
    Assembly: UnityEngine.TestTools.Graphics.dll
    Syntax
    [AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method)]
    public sealed class VerifyRunConfigurationAttribute : Attribute, ITestAction
    Remarks

    The framework checks the run once, before the first test with this attribute:

    • The graphics API, if the command line forces one with -force-d3d11, -force-d3d12, -force-vulkan, -force-metal, -force-glcore or its alias -force-opengl, or -force-gles, including versioned forms such as -force-glcore45 and -force-gles32. On Xbox consoles, the console's Direct3D 12 device satisfies -force-d3d12.
    • The rendering threading mode, if the command line forces one with -force-gfx-direct, -force-gfx-st, -force-gfx-mt or -force-gfx-jobs.
    • WARP, the Direct3D software rasterizer, which the device can be only if the command line asks for it with -force-driver-type-warp. Without the argument, WARP means the GPU driver didn't load.

    Write these arguments in the documented form, the name with one dash and the value after a space, as in -force-gfx-jobs split. A double dash or a value joined with = fails the check, because the engine reads those forms for some arguments and ignores them for others.

    The checks compare the device with the command line of the run, so they don't check a graphics API chosen when the player is built, in the Player Settings or with the Unity Test Runner's --playerGraphicsAPI option. To detect a player that falls back to another graphics API, also pass the matching argument to the run, such as -force-vulkan for a player built for Vulkan. The WARP check applies whichever way the graphics API was chosen.

    If a check fails, the first test with this attribute fails and lists every failed check, and the framework skips the later tests with this attribute. The log shows the result of every check: search it for Run configuration.

    Examples
    [VerifyRunConfiguration]
    public class MySceneTests
    {
        [UnityTest, SceneGraphicsTest("Assets/Scenes")]
        public IEnumerator Run(SceneGraphicsTestCase testCase) { ... }
    }

    Properties

    Targets

    Declaration
    public ActionTargets Targets { get; }
    Property Value
    Type Description
    ActionTargets

    Methods

    AfterTest(ITest)

    Declaration
    public void AfterTest(ITest test)
    Parameters
    Type Name Description
    ITest test

    BeforeTest(ITest)

    Declaration
    public void BeforeTest(ITest test)
    Parameters
    Type Name Description
    ITest test

    Implements

    NUnit.Framework.ITestAction
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)