This directory contains unit test framework for Unity IL2CPP backend.
- Go to
../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktopdirectory. - Run
msbuildto build the project.- Note that Mono must be installed for your *nix environment.
- Note that you must have path to .NET SDKs for your Windows environment (using Visual Studio Developer Command Prompt is easy way if you have it).
- Run
MakeAssets.ps1PowerShell script.
@rem In Windows
powershell -ExecutionPolicy Unrestricted ./MakeAssets.ps1# In *nix
pwsh ./MakeAssets.ps1- Ensure
../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assetsdirectory and its subtree have been generated. - Open this folder with Unity.
- Import
../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assets/Dlldirectory intoAssetsof Unity project with Unity Editor. - Import
../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assets/UnitTestsdirectory intoAssetsof Unity project with Unity Editor. - Import
../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assets/link.xmlfile intoAssetsof Unity project with Unity Editor.
See Unity official document for details.
- Select [[Window]] > [[Unit Test Runner]]
- Click [[PlayMode]] tab.
- If you see [[Enable playmode tests]] button, click it and then restart the Unity editor.
- Ensure one more unit tests are shown in the dialog.
- Click [[Run all]] to run in the Editor.
- Open [[Build Settings]] dialog, and select a platform you want to run tests.
- Note that author only tests in iOS (AOT).
- Click [[Run all in player ({YourSelectedPlatform})]] button to run tests in play-mode.
- If you face an error that the editor cannot find scene file, do following:
- Ensure that auto generated scene (its name should be "InitTestScene{RandomNumber}").
- In [[Build Settings]] dialog, click [[Add Open Scenes]] and check only above auto generated scene.
- Click [[Build and Run]] (or [[Build]] and then run the player built).
- If you face an error that the editor cannot find scene file, do following: