-
Notifications
You must be signed in to change notification settings - Fork 742
Generate a separate test function for every header #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.replace(|c| !char::is_alphanumeric(c), "_") | ||
.replace("__", "_") | ||
.to_lowercase(); | ||
let _ = writeln!(dst, "test_header!(header_{}, {:?});", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think You need to write these in a block to avoid rust-lang/rust#35560
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The include!()
is not itself in a function, so it just pulls in a bunch of test function definitions, and doesn't interact with that bug. I'm getting the same pass/fail rate as #204, only pretty. 😄
test result: FAILED. 120 passed; 1 failed; 0 ignored; 0 measured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good then :)
Do you plan to land everything here (and thus close #204), or splitting the last commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll rebase this once #204 has landed -- further comments over there. :-)
In any case, just update the test for now, let's get this landed, and then polish it later :) |
☔ The latest upstream changes (presumably #263) made this pull request unmergeable. Please resolve the merge conflicts. |
- Header tests can now be run selectively, e.g. `cargo test union` will test all headers with 'union' in the file name. - The list of test functions is generated by `build.rs`, so never needs to be updated. - Clever approach suggested by @fitzgen.
@bors-servo r+ |
📌 Commit a6aa516 has been approved by |
Generate a separate test function for every header - Header tests can now be run selectively, e.g. `cargo test header` will test all headers `cargo test union` will test headers with 'union' in the file name - The list of test functions is generated by `build.rs`, so never needs to be updated - Clever approach suggested by @fitzgen This PR depends on #204, so will include those changes until they're merged into master and this can be rebased. But I'll keep the commits separate.
Thanks for doing this one too :-D |
☀️ Test successful - status-travis |
Don't derive debug on a struct if one of it's members isn't Debug. Add a new test for this case. Fixes rust-lang#261
cargo test header
will test all headerscargo test union
will test headers with 'union' in the file namebuild.rs
, so never needs to be updatedThis PR depends on #204, so will include those changes until they're merged into master and this can be rebased. But I'll keep the commits separate.