tree: e19593ba64ba31b02b27559ed7b0cd2d18c2a759 [path history] [tgz]
  1. hermetic/
  2. non_hermetic/
  3. sample-driver/
  4. BUILD.gn
  5. README.md
examples/drivers/driver_test_realm/README.md

Driver Test Realm Examples

Here are a few examples of Driver Test Realm being used in various languages.

There are 2 different ways of using Driver Test Realm.

Hermetic

This is the recommended way to use Driver Test Realm. Every test gets its own version of the Driver Test Realm component. This means every test is hermetic, or isolated, from the other tests. Tests will not share any state, as each Driver Test Realm is unique to that test.

Non Hermetic

The non-hermetic way of using Driver Test Realm is to have a single Driver Test Realm child component that is shared between every test instance.

The test author needs to be extra careful to make sure that their driver's state is cleared between each tests so that the individual tests do not interact with each other.

Note: In specific languages (like Rust) all tests are run simultaneously in their own thread, which means using the non-hermetic Driver Test Realm has the potential for data races if each test is interacting with the same driver.

Simple

This version of a non-hermetic test does not require any setup, it uses the default configuration of Driver Test Realm. This is the same as starting Driver Test Realm with empty arguments.