docs: Add test.toml info to contributing.md

This commit is contained in:
Nathan Adams 2023-03-27 16:35:05 +02:00
parent b4e374712b
commit 401ed1be77
1 changed files with 3 additions and 1 deletions

View File

@ -146,7 +146,9 @@ Heavily algorithmic code may benefit from unit tests in Rust: create a module `m
Most tests are SWF-based, with the SWFs stored in `tests/tests/swfs/`. They are configured in `tests/tests/regression_tests.rs`. To add a new test, create an `.swf` that runs `trace()` statements. You can do this in several ways, listed below.
Once you have an `.swf`, run it in Flash Player and create a file `output.txt` with the contents of the trace statements. Add the `output.txt`, `test.swf` and either the `test.as` or `test.fla` file to a directory under `tests/tests/swfs/avm1` (or `avm2`) named after what your test tests, and add a line in `regression_tests.rs` to have Ruffle run it.
Once you have an `.swf`, run it in Flash Player and create a file `output.txt` with the contents of the trace statements. Add the `output.txt`, `test.swf` and either the `test.as` or `test.fla` file to a directory under `tests/tests/swfs/avm1` (or `avm2`) named after what your test tests.
Finally, add a `test.toml` in the same directory to control how the test is run - such as how many frames it should take or if we should compare the image it generates. See [tests/README.md](tests/README.md) for information on how the test.toml should look like.
Running `cargo test [your test]` will run the `.swf` in Ruffle and compare the `trace()` output against `output.txt`.