Introduction To Unity Unit Testing | Kodeco

Learn all about the Unity Test Framework and how to set up Unit Tests in your Unity projects.


This is a companion discussion topic for the original entry at https://www.kodeco.com/38240193-introduction-to-unity-unit-testing

Dear Dover

I would like to get test result after run Unit Testing for TestCode?
But I don’t know where to store this data, I hope that exist a file such as xml to contain them.

Could you help me to find or store them after run Unit Testing?

Thank you so much

Hi @dangdinhquang If you read the section on Code Coverage you can find out how to export your test results. Introduction To Unity Unit Testing | Kodeco The Code Coverage package allows you to export to html, so these results can be hosted somewhere if you are using a CI pipeline for testing.

Dear @dover
Thank you for your feedback.
I read all and include Code Coverage section but I see the test result only contain coverage report (C0, C1 …). Actually I mean that I would like to see OK/NG of each TestSuite but I don’t known how to do, could you guide me?

Thank you so much.

You would need to look into the TestRunnerAPI. There is a callback for TestFinished that has the results passed to it :]

https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/extension-get-test-results.html

@dover

Thank you for your feedback
The answer is very helpful

1 Like