Test components are components that implement a test. Tests run in a given environment, and then report whether they passed or failed. Typically tests are written using various testing frameworks, and may report more detailed results such as whether individual test cases within a test suite passed or failed.
The Component Framework allows launching tests as components. Most tests are comprised of a single component - these are typically referred to as unit tests. Some tests exercise multiple components working together - these are typically referred to as integration tests.
A test package may contain one or more test components. Test components are components that implement a test suite. Test packages can also contain other components that are not the test itself, but participate in the test. For instance:
In order to define your test package and components, you should use the appropriate build rules. Refer to the test packages guide.
Every component has a manifest. Test components follow the same manifest syntax as any other components.
A component manifest for a simple unit test might be named meta/my_test.cml
and look as follows:
{ include: [ "syslog/client.shard.cml", "//src/sys/test_runners/gtest/default.shard.cml" ] program: { binary: "bin/my_test" } }
Component manifests for simple unit tests can be generated by the build rules.
To run a Fuchsia test out of your build, execute:
For more information, see Run Fuchsia tests.