SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.6 KiB

4 years ago
  1. # TestRunnerApi
  2. 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).
  3. You can initialize the API like this:
  4. ```c#
  5. var testRunnerApi = ScriptableObject.CreateInstance<TestRunnerApi>();
  6. ```
  7. > **Note**: You can subscribe and receive test results in one instance of the API, even if the run starts from another instance.
  8. The `TestRunnerApi` supports the following workflows:
  9. * [How to run tests programmatically](./extension-run-tests.md)
  10. * [How to get test results](./extension-get-test-results.md)
  11. * [How to retrieve the list of tests](./extension-retrieve-test-list.md)
  12. ## Public methods
  13. | Syntax | Description |
  14. | ------------------------------------------ | ------------------------------------------------------------ |
  15. | `void Execute(ExecutionSettings executionSettings)` | Starts a test run with a given set of [ExecutionSettings](./reference-execution-settings.md). |
  16. | `void RegisterCallbacks(ICallbacks testCallbacks, int priority = 0)` | Sets up a given instance of [ICallbacks](./reference-icallbacks.md) to be invoked on test runs. |
  17. | `void UnregisterCallbacks(ICallbacks testCallbacks)` | Unregisters an instance of ICallbacks to no longer receive callbacks from test runs. |
  18. | `void RetrieveTestList(TestMode testMode, Action<ITestAdaptor> callback)` | Retrieve the full test tree as [ITestAdaptor](./reference-itest-adaptor.md) for a given test mode. |