-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ctest: Add skips and mappings. #4514
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
I've been thinking a bit - I think that for the next PR, you should get tests running against the real cfg.skip_static(c|
![
"some_static",
"other_static",
].contains(c.name())
) The reason I am suggesting this is because there is probably a lot that won't be obvious until this starts processing real code and we see the kind of failures that arise. |
589366b
to
6834c82
Compare
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.
Few small things then I think this should be good to go
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.
Few misc comments, mostly just doc grammar fixes. Looks like there is a test failure
ctest-next/src/generator.rs
Outdated
|
||
/// Is field volatile? | ||
/// | ||
/// This is used to make sure that the generated test code also has the volatile keyword. |
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.
/// This is used to make sure that the generated test code also has the volatile keyword. | |
/// Indicate that a struct field should be marked `volatile`. |
Complete sentence for the summary, then I don't think we need the rest
ctest-next/src/generator.rs
Outdated
/// Is static variable volatile? | ||
/// | ||
/// This is used to make sure that the generated test code also has the volatile keyword. |
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.
/// Is static variable volatile? | |
/// | |
/// This is used to make sure that the generated test code also has the volatile keyword. | |
/// Indicate that a static should be marked `volatile`. |
ctest-next/src/generator.rs
Outdated
/// Is function argument volatile? | ||
/// | ||
/// This is used to make sure that the generated test code also has the volatile keyword. |
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.
/// Is function argument volatile? | |
/// | |
/// This is used to make sure that the generated test code also has the volatile keyword. | |
/// Indicate that a function argument should be marked `volatile`. |
ctest-next/src/generator.rs
Outdated
/// Is function return type volatile? | ||
/// | ||
/// This is used to make sure that the generated test code also has the volatile keyword. |
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.
/// Is function return type volatile? | |
/// | |
/// This is used to make sure that the generated test code also has the volatile keyword. | |
/// Indicate that a function's return type should be marked `volatile`. |
ctest-next/src/generator.rs
Outdated
self | ||
} | ||
|
||
/// Is argument of function an array? |
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.
/// Is argument of function an array? | |
/// Indicate that a function pointer argument is an array. |
ctest-next/src/lib.rs
Outdated
Struct(&'a Struct), | ||
Fn(&'a crate::Fn), | ||
#[expect(unused)] | ||
Field(&'a Struct, &'a Field), | ||
Alias(&'a Type), | ||
Const(&'a Const), | ||
Static(&'a Static), | ||
Type(&'a str), | ||
StructType(&'a str), | ||
UnionType(&'a str), |
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.
Could you add a doc to Struct
and StructType
showing the difference there?
You'll probably need to rebase for the test failure. After that and the above fixes, please clean up history |
b679561
to
67fc632
Compare
ffc49ec
to
27a2ae5
Compare
You just need to re-bless the tests no? The input files had to change at #4525, the new files added here don't reflect that. |
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.
Looks like it should pass now, on to the next one!
Description
This PR adds more methods to the frontend of
TestGenerator
, including the ability to skip items and map their identifiers and types to another if needed. This will be useful when portingctest-test
and for writing cleaner test templates for the other items in the future.Sources
Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI