Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for unit-testing async code in the editor #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dubois
Copy link

@dubois dubois commented Dec 4, 2019

This overlaps #18 and addresses #9. This approach differs in that it uses a Unity-provided package for scheduling coroutines at edit time. It also includes worked examples of how to run async unit tests.

It requires that end users install the package com.unity.editorcoroutine. If the end user is using Unity 2018 or below, they must also manually define HAVE_EDITOR_COROUTINES. In Unity 2019 and above, the define is handled automatically by the included .asmdef file.

If the package com.unity.editorcoroutine is installed,
AsyncCoroutineRunner gains the ability to work at edit time.

In Unity 2019.1 and above, no additional setup is needed.
Otherwise, the symbol HAVE_EDITOR_COROUTINES must also be
manually defined.

Includes unit test.
Addresses part of modesttree#9
Includes sample unit test showing that "await" works at edit time.

Fixes modesttree#9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant