Skip to content
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

Enable Cargo features for quickchecking crate #1180

Merged

Conversation

Projects
None yet
4 participants
@shnewto
Copy link
Contributor

shnewto commented Dec 8, 2017

Logic to enable/disable special casing (due to known issues #550, #684, and #1153) has been exposed as features in the quickchecking crate's Cargo.toml file and corresponding cfg attributes in the source.

In addition to adding Cargo features, this PR represents the following:

  • Documentation in bindgen's CONTRIBUTING.md that points to a new README.md located in the quickchecking crate's directory.
  • The Debug trait was implemented for the HeaderC type. This enables failing property tests to be reported as C source code rather than a Rust data structure.
  • The ArrayDimensionC type is now used in header generation for union, struct, and basic declarations.

Thanks for taking a look and for any feedback!

Closes #1169

r? @fitzgen

Enable Cargo features for quickchecking crate
Logic to enable/disable special casing (due to known issues #550, #684, and #1153) has been exposed as features in the `quickchecking` crate's Cargo.toml file and corresponding `cfg` attributes in the source.

In addition to adding Cargo features, this PR represents the following:
- Documentation in `bindgen`'s CONTRIBUTING.md that points to a new README.md located in the `quickchecking` crate's directory.
- The Debug trait was implemented for the `HeaderC` type. This enables failing property tests to be reported as C source code rather than a Rust data structure.
- The ArrayDimensionC type is now used in header generation for union, struct, and basic declarations.

Thanks for taking a look and for any feedback!

Closes #1169

r? @fitzgen
@fitzgen

fitzgen approved these changes Dec 8, 2017

Copy link
Member

fitzgen left a comment

r=me with a couple nitpicks below -- thanks @snewt !

@@ -224,6 +225,14 @@ uncover hidden bugs is by running `csmith` to generate random headers to test

See [./csmith-fuzzing/README.md](./csmith-fuzzing/README.md) for details.

### Property tests for `bindgen` with `quickchecking`

The `tests/quickchecking` crate genertates property tests for `bindgen`.

This comment has been minimized.

@fitzgen

fitzgen Dec 8, 2017

Member

genertates -> generates

`cargo run`. Additional configuration is exposed through the binary's CLI.

```
$ cargo run --bin=quickchecking -- -h

This comment has been minimized.

@fitzgen

fitzgen Dec 8, 2017

Member

I think it makes sense to only show the -h or --help command invocation, and leave out the command's output. As we add more options/flags the output will change and it is likely we will forget to update this code block.

@fitzgen

This comment has been minimized.

Copy link
Member

fitzgen commented Dec 8, 2017

@bors-servo delegate+

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Dec 8, 2017

✌️ @snewt can now approve this pull request

Address PR change requests
- Fixed misspelling introduced in CONTRIBUTING.md
- Remove `quickchecking -h` output from README.md
@shnewto

This comment has been minimized.

Copy link
Contributor Author

shnewto commented Dec 9, 2017

@bors-servo r=fitzgen

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Dec 9, 2017

📌 Commit 2778fe5 has been approved by fitzgen

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Dec 9, 2017

⌛️ Testing commit 2778fe5 with merge 6355f0a...

bors-servo added a commit that referenced this pull request Dec 9, 2017

Auto merge of #1180 - snewt:feat/quickchecking-cargo-features, r=fitzgen
Enable Cargo features for quickchecking crate

Logic to enable/disable special casing (due to known issues #550, #684, and #1153) has been exposed as features in the `quickchecking` crate's Cargo.toml file and corresponding `cfg` attributes in the source.

In addition to adding Cargo features, this PR represents the following:
- Documentation in `bindgen`'s CONTRIBUTING.md that points to a new README.md located in the `quickchecking` crate's directory.
- The Debug trait was implemented for the `HeaderC` type. This enables failing property tests to be reported as C source code rather than a Rust data structure.
- The ArrayDimensionC type is now used in header generation for union, struct, and basic declarations.

Thanks for taking a look and for any feedback!

Closes #1169

r? @fitzgen
@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Dec 9, 2017

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing 6355f0a to master...

@bors-servo bors-servo merged commit 2778fe5 into rust-lang:master Dec 9, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@shnewto shnewto deleted the shnewto:feat/quickchecking-cargo-features branch Dec 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.