Skip to content

Latest commit

 

History

History
44 lines (26 loc) · 2.89 KB

File metadata and controls

44 lines (26 loc) · 2.89 KB

Tests

Caution

To do meaningful development you have to switch to the Unity fork, as this repository/branch does not contain the tools, test and projects required for development. See Download Sources to learn where to obtain said fork.

glTFast comes with a set of unit and integration tests that ensure the software functions without unexpected errors and certify the correctness of the results. Those tests and the assets they require can be found in the tests package under Packages/com.unity.cloud.gltfast.tests.

Once your project is correctly setup (by either opening one of the provided test projects or following the steps to setup your own project) you'll be able to run all tests via the Test Runner window (under WindowGeneralTest Runner; see Test Framework documentation for details about running tests).

Passing all tests is a requirement for getting a contribution accepted.

On an unmodified copy of glTFast all tests should pass. Once you start introducing changes it's recommended to periodically check that the tests still pass.

If a test doesn't succeed you'll have to investigate if it revealed a flaw in you modification or the tests itself needs to be adjusted.

Adding Tests

If you add new code to glTFast you should also add tests that certify correctness of the new code.

For more information about creating and running tests, consult the documentation of the Unity® Test Framework

Test Assets

Some tests consume glTF™ files or other kinds of test input data. Those test assets can be found in the hidden directory Packages/com.unity.cloud.gltfast.tests/Assets~.

When tests are run in Editor playmode, the test assets are loaded from that location directly.

When tests are run in a player build, GLTFast.Editor.Tests.PreprocessBuild copies all test assets into a directory named gltfast within StreamingAssets, effectively packing the assets with the build and ensuring the files are accessible when the tests are run.

Caution

If you ran the tests in a production project, you need to remove the test folders in StreamingAssets to ensure they don't end up in a production build.

Trademarks

Unity® is a registered trademark of Unity Technologies.

Khronos® is a registered trademark and glTF™ is a trademark of The Khronos Group Inc.