-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
5 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Property tests for `bindgen` with `quickchecking` | ||
|
||
`quickchecking` generates random C headers to test `bindgen` | ||
using the [`quickcheck`][quickcheck] property testing crate. When testing | ||
`bindgen` with `quickchecking`, the generated header files are passed to | ||
`bindgen`'s `csmith-fuzzing/predicate.py` script. If that script fails, | ||
`quickchecking` panics, and you can report an issue containing the test case! | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
|
||
- [Prerequisites](#prerequisites) | ||
- [Running](#running) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## Prerequisites | ||
|
||
Requires `python3` to be in `$PATH`. | ||
|
||
Many systems have `python3` by default but if your OS doesn't, its package | ||
manager may make it available: | ||
|
||
``` | ||
$ sudo apt install python3 | ||
$ brew install python3 | ||
$ # Etc... | ||
``` | ||
|
||
## Running | ||
|
||
Run `quickchecking` binary to generate and test fuzzed C headers with | ||
`cargo run`. Additional configuration is exposed through the binary's CLI. | ||
|
||
``` | ||
$ cargo run --bin=quickchecking -- -h | ||
``` | ||
[quickcheck]: https://github.com/BurntSushi/quickcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters