zerocopy icon indicating copy to clipboard operation
zerocopy copied to clipboard

preliminary ui test examples

Open IsaacCloos opened this issue 3 years ago • 1 comments

#17

This is an example of a possible file layout for extracting every api misuse from rustc. As elaborated on here it is the design of the rust compiler to express errors in ways that limit trybuild's ability to clump several intra-stack errors together. If I have missed a solution to this please let me know! In the meantime I have separated a handful of read_from api misuses into separate files so that they can all be thrown accordingly and then correctly compared to the relative *.stderr file.

This is in comparison to the zerocopy-derive>tests>ui>[enum | struct | union].rs format where many errors are collected from a single file and can be accounted for concisely.


I also took the liberty of copying over the #[rustversion] logic from zerocopy-derive. https://github.com/google/zerocopy/blob/e5e9b1fa05933750db526a489f73050032c5eb70/zerocopy-derive/tests/trybuild.rs#L18-L23 Please let me know if you have different plans for zerocopy's tests!

Criticism Welcome 😄

This is a preliminary draft to get a feel for how you'd like these tests to be set up, and get notes on how I've set three tests up already. Thanks!

IsaacCloos avatar Oct 17 '22 22:10 IsaacCloos

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Oct 17 '22 22:10 google-cla[bot]