Skip to content

feat: add React Native runtime for running CTS tests#4568

Draft
wcandillon wants to merge 2 commits intogpuweb:mainfrom
wcandillon:rn-runtime
Draft

feat: add React Native runtime for running CTS tests#4568
wcandillon wants to merge 2 commits intogpuweb:mainfrom
wcandillon:rn-runtime

Conversation

@wcandillon
Copy link

@wcandillon wcandillon commented Jan 20, 2026

Add a React Native compatible runtime that works with bundlers that don't
support dynamic imports (like Metro).

The runtime uses pre-generated static imports instead of dynamic import().
Projects need to generate an all_specs.ts file at build time using the
provided gen_rn_specs.ts tool or equivalent.

Files added:

  • src/common/runtime/rn/loader.ts - ReactNativeTestFileLoader class
  • src/common/runtime/rn/runtime.ts - CTSRunner class and utility functions
  • src/common/runtime/rn/index.ts - Public exports
  • src/common/runtime/rn/README.md - Documentation and usage examples
  • src/common/tools/gen_rn_specs.ts - Tool to generate static imports

Usage:

import { CTSRunner } from './common/runtime/rn';
import { allSpecs } from './common/runtime/rn/generated/all_specs';

const runner = new CTSRunner(allSpecs, { debug: false });
const { summary } = await runner.runTests('webgpu:api,operation,adapter,*');

Note: React Native requires polyfills for Event, EventTarget, and MessageEvent.
See README.md for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant