Debian Codegraph @

test/diff/diff_files/README.md

raw
1 # Diff tests
2
3 This directory contains files used to ensure correctness of the `spirv-diff` implementation. The
4 `generate_tests.py` script takes `name_src.spvasm` and `name_dst.spvasm` (for each `name`) and
5 produces unit test files in the form of `name_autogen.cpp`.
6
7 The unit test files test the diff between the src and dst inputs, as well as between debug-stripped
8 versions of those. Additionally, based on the `{variant}_TESTS` lists defined in
9 `generate_tests.py`, extra unit tests are added to exercise different options of spirv-diff.
10
11 New tests are added simply by placing a new `name_src.spvasm` and `name_dst.spvasm` pair in this
12 directory and running `generate_tests.py`. Note that this script needs the path to the spirv-diff
13 executable that is built.
14
15 The `generate_tests.py` script additionally expects `name_src.spvasm` to include a heading where the
16 purpose of the test is explained. This heading is parsed as a block of lines starting with `;;` at
17 the top of the file.