{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Workflow: Running tests | Test Framework | 2.0.1-exp.2
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Workflow: Running tests

    There are several ways to run tests in the Test Runner window:

    • Double-click on the test or test fixture name.
    • Use the Run All or Run Selected buttons at the bottom of the window.
    • Right-click on any item in the test tree and choose Run in the context menu to run the test and all of its children.

    When you run a test the test status icon changes to show the result and a counter in the top right corner updates:

    Run Test

    Filters

    If you have a lot of tests, and you only want to view/run a sub-set of them, you can filter them in several ways (see image above):

    • Type in the search box in the top left

    • Click a test class or fixture (such as NewTestScript in the image above)

    • Click one of the test result icon buttons in the top right

    • Select or deselect the EditMode and PlayMode check boxes to include or exclude tests of that type.

    Running tests from the command line

    You can also run a test project from the Unity command line. Here is an example in Windows:

    Unity.exe -runTests -batchmode -projectPath PATH_TO_YOUR_PROJECT -testResults C:\temp\results.xml -testPlatform PS4
    

    Note: Use the -batchmode option when running tests on the command line to remove the need for manual user inputs. For more information, see Unity Command line arguments.

    For the full list of Unity Test Framework command line arguments, see the command line reference.

    Run tests within Rider

    It is possible to run unit tests in the Unity Test Framework directly from JetBrains Rider.

    For more information, see the JetBrains official documentation and their blog post Run Unity tests in Rider 2018.1.

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