Skip to content

Setup for Unity game

msporna edited this page Jan 8, 2019 · 9 revisions

This page lists steps required to make LAVA work with C# Unity games

  1. Do the initial setup: https://github.com/msporna/LAVA-test-coverage/wiki/Initial-setup or skip if done already
  2. Open client/config.json and update required fields:
source_root_absolute_path: [absolute path to the Scripts folder within the project]
INJECT_MODE: "unity"

All paths must be absolute. For config details go to config.json-explained page.

  1. start LAVA server from /server folder by executing the following command manually:
python instrument_server.py

or if you are on Windows you can simply run:

run_api_windows.bat
  1. copy LavaTestCoverage folder from LAVA project_root/helpers/unity_plugin into your project/Assets/Plugins

  2. go to /client folder and from your terminal run python instrument_client.py and pass config.json path as command line argument so the command becomes: python instrument_client.py config.json

  3. the process of injecting probes will start

  4. check your project's source files, should be appended by instrumentation code

  5. there is a LavaTestCoverageGameObject located in Plugins/LavaTestCoverage/LavaHelper/ - Add it to each scene you are testing.

  6. your game is now ready to be tested and coverage stats will be gathered - don't forget to build your game (it will be built along with injected probes code lines)

related example: https://github.com/msporna/LAVA-test-coverage/tree/master/examples/unity_demo

Clone this wiki locally