Skip to content

Autogenerate compile tests for INIT macros#581

Merged
kainino0x merged 1 commit intowebgpu-native:mainfrom
kainino0x:init-test
Feb 20, 2026
Merged

Autogenerate compile tests for INIT macros#581
kainino0x merged 1 commit intowebgpu-native:mainfrom
kainino0x:init-test

Conversation

@kainino0x
Copy link
Collaborator

@kainino0x kainino0x commented Feb 14, 2026

Replace the manually-maintained INIT test lines with autogenerated tests. Used a quick hack in perl (only tool I could find that could do this easily), it just finds all the INIT macros defined in the header and outputs a test for each one.

It's checked into the repo (instead of generated during build) so that I don't have to deal with making it work on the Windows compile test.

This should have caught some missing items in #580

@kainino0x kainino0x force-pushed the init-test branch 3 times, most recently from 0c7210c to 972cbd7 Compare February 14, 2026 00:19
@lokokung
Copy link
Collaborator

Fine to have this as is for now, but it should be fairly simple to make a template + generator to do this and add a presubmit check for it as well. Otherwise, this will just get out of date when/if we add new structs.

@kainino0x
Copy link
Collaborator Author

It's regenerated by make gen and checked for freshness on presubmit just like webgpu.h. I just did it with Perl instead of making a new output file from the Go generator because it was simpler.

@kainino0x kainino0x requested a review from lokokung February 20, 2026 00:43
@lokokung
Copy link
Collaborator

Ooo, sorry I didn't catch that on the first pass. Makes sense! Thanks!

@kainino0x kainino0x merged commit 74472a7 into webgpu-native:main Feb 20, 2026
5 checks passed
@kainino0x kainino0x deleted the init-test branch February 20, 2026 02:11
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.

2 participants