Reviewed on: 2020-04-20
GTest Runner is a test runner that launches a gtest binary as a component, parses its output, and translates it to fuchsia.test.Suite protocol on behalf of the test.
fx set core.x64 --with //src/sys/test_runners/gtest fx build
Examples to demonstrate how to write v2 test
To run this example:
fx run-test gtest-runner-example-tests
Test cases are executed sequentially by default. Instruction to override.
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.
Note the following known behavior change:
gtest_break_on_failure: As each test case is executed in a different process, this flag will not work.
The following flags are restricted and the test fails if any are passed as fuchsia.test.Suite provides equivalent functionality that replaces them
GTEST_SKIP(), it will be recorded as
Passedrather than as
Skipped. This is due to a bug in gtest itself.
fx run-test gtest_runner_tests
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.