Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upQuickchecking crate CLI #1177
Conversation
highfive
assigned
fitzgen
Dec 5, 2017
highfive
added
the
S-awaiting-review
label
Dec 5, 2017
This comment has been minimized.
This comment has been minimized.
|
For sanity here are a couple fuzzed headers generated with the state of the current code. |
shnewto
force-pushed the
shnewto:feat/quickcheck-as-bin
branch
from
9b38bd4
to
b4ba092
Dec 5, 2017
fitzgen
approved these changes
Dec 5, 2017
|
Looks great! Now that the tests are about the quickchecking crate itself, rather than actually quickchecking Once you add that, you can comment Thanks! |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo delegate+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@fitzgen ah awesome, can do (this evening). |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=fitzgen |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors-servo
added a commit
that referenced
this pull request
Dec 6, 2017
highfive
added
S-awaiting-merge
and removed
S-awaiting-review
labels
Dec 6, 2017
This comment has been minimized.
This comment has been minimized.
|
|
shnewto commentedDec 5, 2017
Prior to this commit the quickchecking crate used for generating proprty tests for bindgen was a [lib] target and had configurations that required commenting/uncommenting code to enable/disable. This meant it was inconvienent/prohibitive to configure the property tests on a per-run basis. This commit reorganizes the
quickcheckingcrate to provide both [lib] and [[bin]] targets in order to expose those configurations through a CLI.The configurations that are exposed through the [[bin]] target's CLI are:
Usage from the
tests/quickcheckingdirectoryquickchecking 0.2.0 Bindgen property tests with quickcheck. Generate random valid C code and pass it to the csmith/predicate.py script USAGE: quickchecking [OPTIONS] FLAGS: -h, --help Prints help information -V, --version Prints version information OPTIONS: -c, --count <COUNT> Count / number of tests to run. Running a fuzzed header through the predicate.py script can take a long time, especially if the generation range is large. Increase this number if you're willing to wait a while. [default: 2] -p, --path <PATH> Optional. Preserve generated headers for inspection, provide directory path for header output. [default: None] -r, --range <RANGE> Sets the range quickcheck uses during generation. Corresponds to things like arbitrary usize and arbitrary vector length. This number doesn't have to grow much for that execution time to increase significantly. [default: 32]Because the actual work of running the property tests moved to the [[bin]]
target, rather than duplicate that code in the
quickcheckingcrate's testsdirectory, some actual (very basic) tests for the
quickcheckingcrate wereadded.
*Note: I'm not attached to any of the option flags, if there are better characters/words for any of the options I've exposed I'll be happy to revise!
Also, I'm not sure how palatable the "global singleton" is for managing context (output path) across tests in the
lib.rsfile. Very open to suggestions on how to manage that if it's not an acceptable approach.Thanks for taking a look, looking forward to feedback!
Closes #1168
r? @fitzgen