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
merged 2 commits into from
Dec 9, 2017
Merged

Enable Cargo features for quickchecking crate #1180

merged 2 commits into from
Dec 9, 2017

Conversation

shnewto
Copy link
Contributor

@shnewto 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

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
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

CONTRIBUTING.md Outdated
@@ -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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genertates -> generates

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

```
$ cargo run --bin=quickchecking -- -h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

fitzgen commented Dec 8, 2017

@bors-servo delegate+

@bors-servo
Copy link

✌️ @Snewt can now approve this pull request

- Fixed misspelling introduced in CONTRIBUTING.md
- Remove `quickchecking -h` output from README.md
@shnewto
Copy link
Contributor Author

shnewto commented Dec 9, 2017

@bors-servo r=fitzgen

@bors-servo
Copy link

📌 Commit 2778fe5 has been approved by fitzgen

@bors-servo
Copy link

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

bors-servo pushed a commit that referenced this pull request Dec 9, 2017
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
Copy link

☀️ 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
@shnewto shnewto deleted the feat/quickchecking-cargo-features branch December 9, 2017 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants