# Running tests from code

> Run tests from code with the TestRunnerAPI.

You can invoke Unity Test Framework's test runner from code with the [`TestRunnerAPI`](https://docs.unity3d.com/Packages/com.unity.test-framework@latest/index.html?subfolder=/api/UnityEditor.TestTools.TestRunner.Api.TestRunnerApi.html) class, which lets you control which tests are run and retrieve test data and results.

| **Topic**                                                                                                                                             | **Description**                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **[Specify which tests to run](/engine/6000.3/manual/scripting/test-framework-introduction/running-tests/from-code/extension-run-tests.md)**          | Compose [`Filter`](https://docs.unity3d.com/Packages/com.unity.test-framework@latest/index.html?subfolder=/api/UnityEditor.TestTools.TestRunner.Api.Filter.html) objects for the [`TestRunnerAPI`](https://docs.unity3d.com/Packages/com.unity.test-framework@latest/index.html?subfolder=/api/UnityEditor.TestTools.TestRunner.Api.TestRunnerApi.html) to determine which tests to include in a test run. |
| **[Retrieving test results](/engine/6000.3/manual/scripting/test-framework-introduction/running-tests/from-code/extension-get-test-results.md)**      | Register to receive callbacks from the test runner at the start or finish of an active test run or individual test.                                                                                                                                                                                                                                                                                        |
| **[Retrieve the list of tests](/engine/6000.3/manual/scripting/test-framework-introduction/running-tests/from-code/extension-retrieve-test-list.md)** | Retrieve the test tree for a given test mode (Edit mode or Play mode) from the test runner.                                                                                                                                                                                                                                                                                                                |

## Additional resources

* [Run tests in the Test Runner window](/engine/6000.3/manual/scripting/test-framework-introduction/running-tests/workflow-run-test.md)
* [Run tests from the command line](/engine/6000.3/manual/scripting/test-framework-introduction/running-tests/run-tests-from-command-line.md)
