Rust Test Runner

Reviewed on: 2020-04-20

Rust test runner is a test runner that launches a rust test binary as a component, parses its output, and translates it to the fuchsia.test.Suite protocol on behalf of the test.

Building

fx set core.x64 --with //src/sys/test_runners/rust
fx build

Examples

Examples to demonstrate how to write v2 test:

To run this example:

fx run-test rust-test-runner-example

Limitations

Currently rust test runner doesn't support:

  • Skipped tests(fxb/50793): Rust runner will always run all the tests weather skipped or not. The only way to skip a test is to comment it out.

Testing

Run:

fx run-test rust-test-runner-unit-tests

fx run-test rust-runner-integration-test

Source layout

The entrypoint is located in src/main.rs, the FIDL service implementation and all the test logic exists in src/test_server.rs. Unit tests are co-located with the implementation. Integration tests are located in tests folder.