David Neto | 750120f | 2023-09-19 21:15:38 +0000 | [diff] [blame] | 1 | # Testing Tint |
| 2 | |
| 3 | Tint has multiple levels of testing: |
| 4 | |
| 5 | * Unit tests, using the Googletest framework. These are the lowest level tests, |
| 6 | comprehensively checking functionality of internal functions and classes. |
| 7 | The test code is inside the Tint source tree in files with names ending in |
| 8 | `_test.cc` |
David Neto | c8ccd3d | 2024-05-02 18:32:17 +0000 | [diff] [blame] | 9 | |
| 10 | To run them, build the `tint_unittests` target to produce the `tint_unittests` |
| 11 | executable, and then run the executable. |
| 12 | |
| 13 | The `tint_unittests` executable supports all the standard Googletest command |
| 14 | line options, e.g. using filters to run only a subset of the tests. |
| 15 | See [Running Test Programs: Advanced |
| 16 | Options](https://google.github.io/googletest/advanced.html#running-test-programs-advanced-options) |
| 17 | |
David Neto | 750120f | 2023-09-19 21:15:38 +0000 | [diff] [blame] | 18 | * End-to-end tests. These test the whole compiler flow, translating source |
| 19 | shaders to output shaders in various languages, and optionally checking |
Jiawei Shao | b9feb09 | 2024-01-10 11:19:09 +0000 | [diff] [blame] | 20 | the text of diagnostics. See [Tint end-to-end tests](end-to-end-tests.md). |
David Neto | c8ccd3d | 2024-05-02 18:32:17 +0000 | [diff] [blame] | 21 | |
David Neto | 750120f | 2023-09-19 21:15:38 +0000 | [diff] [blame] | 22 | * WebGPU Conformance Test Suite (CTS). The WebGPU CTS has both validation and |
| 23 | execution tests, in the `webgpu:shader` hierarchy. |
| 24 | See https://github.com/gpuweb/cts |
| 25 | All test can be run in Chrome, and many tests can be run via `dawn.node`, |
| 26 | the [Dawn bindings for NodeJS](../../src/dawn/node/README.md). |