MessagePack for CLI Unit Test for Unity IL2CPP
This directory contains unit test framework for Unity IL2CPP backend.
- Go to ../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop directory.
- Run msbuild to 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.ps1 PowerShell script.
@rem In Windows
powershell -ExecutionPolicy Unrestricted ./MakeAssets.ps1
# In *nix
pwsh ./MakeAssets.ps1
- Ensure ../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assets directory and its subtree have been generated.
- Open this folder with Unity.
- Import ../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assets/Dll directory into Assets of Unity project with Unity Editor.
- Import ../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assets/UnitTests directory into Assets of Unity project with Unity Editor.
- Import ../MsgPack.UnitTest.Unity.Il2cpp.Full.Desktop/Assets/link.xml file into Assets of 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).