blob: 97f0f096d29ed3b1e7646b48806514029eb5e46b [file] [view]
# Rust Test Runner
Reviewed on: 2020-04-20
Rust test runner is a [test runner][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
```bash
fx set core.x64 --with //src/sys/test_runners/rust
fx build
```
## Examples
Examples to demonstrate how to write v2 test:
- [Sample test](test_data/sample-rust-tests/meta/sample_rust_tests.cml)
To run this example:
```bash
fx run-test rust-test-runner-example
```
## Concurrency
Test cases are executed concurrently (max 10 test cases at a time by default).
[Instruction to override][override-parallel].
## Arguments
Test authors can specify command line arguments to their tests in their
component manifest file. These will be passed to the test when it is run.
The following flags are restricted and the test fails if any are passed as
fuchsia.test.Suite provides equivalent functionality that replaces them
- `nocapture`
- `list`
## Limitations
No known current limitations.
## Testing
Run:
```bash
fx run-test rust-test-runner-unit-test
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.
[test-runner]: ../README.md
[override-parallel]: /docs/concepts/testing/v2_test_component.md#running_test_cases_in_parallel