Skip to content

wgsl-tooling-wg/wesl-testsuite

Repository files navigation

WESL Examples for Testing

This package contains wesl source texts useful for tool builders to verify WESL parsing and linking.

Test Format

The source texts are published as an array of objects in both JSON and TypeScript format. The format is described in: TestSchema.ts

JSON version: importCases.json importSyntaxCases.json conditionalTranslation.json

TypeScript version: ImportCases.ts ImportSyntaxCases.ts ConditionalTranslation.ts

Adding New Tests

Author new examples in TypeScript. (TypeScript is similar to JSON but a little more user friendly for authoring.)

A tool is included in the package to convert the TypeScript objects to JSON.

Convert TypeScript Tests to JSON

Install dependencies

pnpm install

Generate JSON test cases from TypeScript

pnpm cases

Generate JSON test cases from TypeScript continuously

pnpm cases:watch

License

Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:

at your option.

Your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Shared tests for WGSL imports

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •