Package-level declarations
@TapTest, @TapDevice, @TapDevices, Devices, tapTest and the configuration it reads.
Types
Turns off the end-of-test app death check (tap.appDeaths) for a test method or every test of a class (its subclasses and @Nested classes too): a watched app that crashes or stops responding fails the test only through a command that fails because of it. For tests that kill the app on purpose throughout; for one section, prefer allowDeaths { } or expectDeath { }.
What the JUnit extension does about an app that died during a test (tap.appDeaths).
When the JUnit extension captures device artifacts (tap.capture).
Coroutine coordination for simultaneous multi-device phases. All waiting is suspension (await), never thread blocking, and cancellation is safe: a waiter cancelled before the barrier trips leaves the barrier intact for the rest.
Whether a role wants an emulator or a real device (RequireDevice.kind).
How long the JUnit extension keeps a test's devices attached (TapTest.deviceLifetime).
Which devices may play role, from what the server reports about them (DeviceEntry.properties). On a test method or class, once per role; a method's annotation replaces its class's for the same role, and the role must be one the test declares (a Device parameter, TapDevice or TapDevices). Every part that is set must hold. A device whose properties the server could not read fits no criteria, and a role pinned with tap.device.<role> must fit too. When no available device (or no combination of them, for several roles) fits, the test is skipped before anything is attached, naming the devices it saw.
Resolved once per JVM from system properties, falling back to environment variables named by envName (tap.artifactsDir → TAP_ARTIFACTS_DIR, tap.device.sender → TAP_DEVICE_SENDER).
Declares the named roles a test (or every test in a class) needs; inject them as Devices.
Per-test device sessions for JUnit 5, over the coroutine client. Before each test it maps every declared role to a serial (rotating the starting device from test to test; a single-role test also moves on to the next device when one is busy), creates the per-test root Job, and opens one driver session per role — in sorted serial order, waiting up to tap.acquireTimeoutSeconds for a device another session holds, so two multi-device tests can never deadlock — all as children of the root job. The test body runs only inside tapTest, which binds this state and installs the SDK TapContext, in the test method and in its @BeforeEach / @AfterEach methods; Device calls outside it fail with a usage error, so plain metadata-only tests stay possible but cannot touch live devices.
Registered through META-INF/services; closes SharedConnection once all tests have run.
Writes tap-run/1 records for one launcher execution containing Tap tests. Loaded by the JUnit Platform service loader; does no device work and never changes a test outcome.
Enables Tap for a test class: one driver session per declared role is opened before each test and closed (with failure artifacts captured first) after it.
Functions
The mandatory entry point for suspending framework calls in JUnit tests: @Test fun x(device: Device) = tapTest { ... } (a block body works too). tapTest returns Unit, so the test method compiles to a void JUnit can discover whatever the block's last expression is. JUnit test methods are not suspend, so this is the real-time runBlocking-style bridge onto the extension-owned per-test context (root job + TapContext); it never uses virtual time because ADB, devices and command deadlines are external real-time systems.