Skip to main content

gpu_test_main

Macro gpu_test_main 

Source
macro_rules! gpu_test_main {
    ($tests:expr) => { ... };
}
Expand description

Provides the entry point a test binary drives its catalog through.

$tests is an expression evaluating to Vec<TestEntry>. The same file therefore serves both runners: natively this is the test binary’s main, and in a wasm build it is the export the page calls.

A native run with WASM_TEST_ENV set becomes the browser’s proxy rather than a runner, so a test binary compiled for the host still lists and reports every test while the bodies run in a page.

The caller needs wasm-bindgen in scope, because the attribute below expands to paths naming that crate. It is a wasm-only dependency of the test crates, so nothing pays for it on a platform that has no wasm.