ail: Restructure generated tests
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 10 Mar 2023 02:01:02 +0000 (21:01 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sat, 11 Mar 2023 20:45:42 +0000 (20:45 +0000)
commit7e908878c1960cf518d8c110a3e56eac39971a2a
tree83b3392bba3f00c6202da2ab7483e0f22c6ec64c
parent43e21702f65a5a22e5d38c3e459153290d321050
ail: Restructure generated tests

Currently, the generated tests consist of some boilerplate, generated
test cases, and at the very end the actual test. This is bad for readability,
because the actual code is all the way at the bottom. It's also bad for
clang-format linting: even though the test cases are /* clang-format off */,
they still take an exceptionally long time to parse when linting. I suspect this
is a clang-format bug, but it's easy enough to workaround.

To solve these issues, restructure so that the test cases are in separate files
(containing the actual data), but the manually written test functions are
consolidated into a new family of generated layout tests. This is probably
cleaner.

Parallel clang-format linting is now 10x faster on the M1, which means it's
now practical to lint in my "publish branch" hook.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21854>
src/asahi/layout/meson.build
src/asahi/layout/tests/comp-twiddled.txt [moved from src/asahi/layout/tests/test-comp-twiddled.cpp with 99% similarity]
src/asahi/layout/tests/miptree.txt [moved from src/asahi/layout/tests/test-miptree.cpp with 88% similarity]
src/asahi/layout/tests/test-generated.cpp [new file with mode: 0644]
src/asahi/layout/tests/uncomp-twiddled.txt [moved from src/asahi/layout/tests/test-uncomp-twiddled.cpp with 99% similarity]