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

NUnit integration #21

Open
enlight opened this issue Sep 16, 2014 · 1 comment
Open

NUnit integration #21

enlight opened this issue Sep 16, 2014 · 1 comment

Comments

@enlight
Copy link
Owner

enlight commented Sep 16, 2014

The C# wrappers generated by KlawrCodeGenerator need a bunch of tests to ensure the method parameter and property data is being passed across the native/managed boundary as expected.

@enlight
Copy link
Owner Author

enlight commented Sep 22, 2014

Looks like the alpha release of NUnit v3 is due any day now, so it's probably best to wait until that happens instead of starting off with v2 and then upgrading.

The plan is roughly this:

  • Add a new Klawr.Tests assembly to Engine/Source/ThirdParty/Klawr/
  • Klawr.Tests will reference NUnit and Klawr.UnrealEngine assemblies.
  • Klawr.Tests will contain a UKlawrScriptComponent subclass that will execute the NUnit LocalTestRunner when ticked, which in turn will run tests in the current app domain.
  • Klawr.Tests will also contain some actual test classes to be run by NUnit.
  • The Klawr.Tests project will have a post-build event that copies it to the engine binaries directory (same one Klawr.UnrealEngine ends up in).
  • Create a new Tests directory in Engine/Plugins/Klawr/KlawrRuntimePlugin/Source/KlawrRuntimePlugin/Private/
  • Add a UE4 automation test to construct a UKlawScriptComponent and associate it with the corresponding C# type from Klawr.Tests, the native UKlawScriptComponent instance can then be ticked once to run all the tests in the Klawr.Tests assembly. Here's an example of a simple UE4 test.
  • Devise some way to display output/results from the NUnit test runner in the UE4 automation front end (or whatever runs those automation tests).

Potentially useful links about running NUnit in-process (though they relate to NUnit v2):
https://stackoverflow.com/a/5241900
https://stackoverflow.com/a/13210613

NUnit v3 has the Test Engine API, which may be of some use.

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

No branches or pull requests

1 participant