docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Namespace UnityEditor.TestTools.TestRunner.Api

    Classes

    ExecutionSettings

    A set of execution settings defining how to run tests, using the TestRunnerApi.

    Filter

    The filter class provides the TestRunnerApi with a specification of what tests to run when running tests programmatically.

    TestRunnerApi

    The TestRunnerApi retrieves and runs tests programmatically from code inside the project, or inside other packages. TestRunnerApi is a [ScriptableObject](https://docs.unity3d.com/ScriptReference/ScriptableObject.html). You can initialize the API like this:

    var testRunnerApi = ScriptableObject.CreateInstance<TestRunnerApi>();

    Note: You can subscribe and receive test results in one instance of the API, even if the run starts from another instance. The TestRunnerApi supports the following workflows: - [How to run tests programmatically](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/extension-run-tests.html) - [How to get test results](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/extension-get-test-results.html) - [How to retrieve the list of tests](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/extension-retrieve-test-list.html)

    Interfaces

    ICallbacks

    Callbacks in the TestRunnerApi for the test stages when running tests.

    IErrorCallbacks

    An extended version of the ICallbacks, which get invoked if the test run fails due to a build error or if any IPrebuildSetup has a failure.

    ITestAdaptor

    ITestAdaptor is a representation of a node in the test tree implemented as a wrapper around the NUnit ITest interface.

    ITestResultAdaptor

    The ITestResultAdaptor is the representation of the test results for a node in the test tree implemented as a wrapper around the NUnit ITest interface.

    ITestRunSettings

    ITestRunSettings lets you set any of the global settings right before building a Player for a test run and then reverts the settings afterward. ITestRunSettings implements IDisposable, and runs after building the Player with tests.

    Enums

    RunState

    The RunState enum indicates whether a test can be executed.

    TestMode

    A flag indicating whether to run Edit Mode or Play Mode tests.

    TestStatus

    The TestStatus enum indicates the test result status.

    In This Article
    Back to top
    Copyright © 2025 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)