Skip to content

Commit 2aa9b1d

Browse files
committed
Address requested changes to quickchecking crate.
- Remove `whitelistable` and `blacklistable` types. - Rename test crate directory from `property_test` to `quickchecking`. - Add new CI job that checks that this crate continues to build. - Revise matching logic to be more idomatic. - Phase out modular arithmetic in favor of `gen_range`. - Incorporate `unreachable!` into match statements. - Revise logic for accessing random element of vector, favor `choose` over `nth`. - Proper punctuation and capitalization in comments. - Using actual structures rather than converting everything to strings in order to leverage type system. - Add `#![deny(missing_docs)]` and filled in documentation required for the project to build again. - Add special case logic so we don't generate structs with `long double` fields as it will cause tests to fail unitl issue \#550 is resolved Note on making sure we don't lose test cases we're interested in preserving: We're copying the directories `TempDir` makes so we get things like this: ``` ├── bindgen_prop.1WYe3F5HZU1c │   └── prop_test.h ├── bindgen_prop.H4SLI1JX0jd8 │   └── prop_test.h ``` I'm not sure that `TempDir` makes any claims about uniqueness, so collisions probably aren't impossible. I'm up for any suggestions on a more bulletproof solution. _Tasks not addressed by this PR:_ * TODO: Add `cargo features` logic to allow generating problematic code. * TODO: Make a [bin] target with CLI to manage test settings. * TODO: Whitelisting and opaque types. * TODO: Generate bitfields, C++, I-bogus-codegen cases. Figured this would be a good point to update the PR but if any of the above TODO items should be incorporated before moving forward I'm up for it! Thanks for taking another look! r? @fitzgen
1 parent c981808 commit 2aa9b1d

File tree

9 files changed

+655
-498
lines changed

9 files changed

+655
-498
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ env:
3838
- LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
3939
- LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
4040
- LLVM_VERSION="4.0.0" BINDGEN_JOB="misc"
41+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="quickchecking"
4142

4243
matrix:
4344
fast_finish: true

ci/script.sh

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ case "$BINDGEN_JOB" in
3838
# ./ci/assert-rustfmt.sh
3939
;;
4040

41+
"quickchecking")
42+
cd ./tests/quickchecking
43+
# TODO: Actually run quickchecks once `bindgen` is reliable enough.
44+
cargo check
45+
;;
4146
*)
4247
echo "Error! Unknown \$BINDGEN_JOB: '$BINDGEN_JOB'"
4348
exit 1

tests/property_test/Cargo.toml

-10
This file was deleted.

0 commit comments

Comments
 (0)