You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is fine on a small scale but as we flesh out more of this kind of test, it's going to be better to have tests that can be programmatically kept up to date. Like a directory of input source files and the complete output of the code generator against those files, with a single script to update them all when iterating on the code generator (or instead of a script, maybe we run the test with a specific env var to overwrite the snapshots, as https://github.com/dtolnay/trybuild does).
#231 implemented a couple basic code generator tests just based on
str::contains
like this:cxx/gen/src/mod.rs
Lines 89 to 91 in 447c808
This is fine on a small scale but as we flesh out more of this kind of test, it's going to be better to have tests that can be programmatically kept up to date. Like a directory of input source files and the complete output of the code generator against those files, with a single script to update them all when iterating on the code generator (or instead of a script, maybe we run the test with a specific env var to overwrite the snapshots, as https://github.com/dtolnay/trybuild does).
This is how the Rust compiler does its MIR tests (https://github.com/rust-lang/rust/blob/6b269e44322cfca727fd0e793d3a60bd371cbcae/src/test/mir-opt/README.md).
x.py test --bless
updates them all, and we can inspect the generated diff to tell whether the changes are as intended.The text was updated successfully, but these errors were encountered: