Lines Matching +full:runner +full:- +full:before +full:- +full:script
8 <!-- START doctoc generated TOC please keep comment here to allow auto update -->
9 <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
11 - [Code of Conduct](#code-of-conduct)
12 - [Filing an Issue](#filing-an-issue)
13 - [Looking to Start Contributing to `bindgen`?](#looking-to-start-contributing-to-bindgen)
14 - [Building](#building)
15 - [Testing](#testing)
16 - [Overview](#overview)
17 - [Testing Bindings Generation](#testing-bindings-generation)
18 - [Testing Generated Bindings](#testing-generated-bindings)
19 …- [Testing a Single Header's Bindings Generation and Compiling its Bindings](#testing-a-single-hea…
20 - [Authoring New Tests](#authoring-new-tests)
21 - [Test Expectations and `libclang` Versions](#test-expectations-and-libclang-versions)
22 - [Integration Tests](#integration-tests)
23 - [Fuzzing `bindgen` with `csmith`](#fuzzing-bindgen-with-csmith)
24 …- [Property tests for `bindgen` with `quickchecking`](#property-tests-for-bindgen-with-quickchecki…
25 - [Code Overview](#code-overview)
26 - [Implementing new options using `syn`](#implementing-new-options-using-syn)
27 - [Pull Requests and Code Reviews](#pull-requests-and-code-reviews)
28 - [Generating Graphviz Dot Files](#generating-graphviz-dot-files)
29 - [Debug Logging](#debug-logging)
30 - [Using `creduce` to Minimize Test Cases](#using-creduce-to-minimize-test-cases)
31 - [Getting `creduce`](#getting-creduce)
32 - [Isolating Your Test Case](#isolating-your-test-case)
33 - [Writing a Predicate Script](#writing-a-predicate-script)
34 - [Cutting a new bindgen release](#cutting-a-new-bindgen-release)
35 - [Updating the changelog](#updating-the-changelog)
36 - [Bumping the version numbers.](#bumping-the-version-numbers)
37 - [Merge to `main`](#merge-to-main)
38 …- [Publish and add a git tag for the right commit](#publish-and-add-a-git-tag-for-the-right-commit)
40 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
46 [coc]: https://www.rust-lang.org/en-US/conduct.html
61 …[Issues labeled "easy"](https://github.com/rust-lang/rust-bindgen/issues?q=is%3Aopen+is%3Aissue+la…
62 …labeled "less easy"](https://github.com/rust-lang/rust-bindgen/issues?q=is%3Aopen+is%3Aissue+label…
63 * [Issues labeled "help wanted"](https://github.com/rust-lang/rust-bindgen/labels/help%20wanted)
64 * Still can't find something to work on? [Drop a comment here](https://github.com/rust-lang/rust-bi…
79 $ export LIBCLANG_PATH=path/to/clang-9.0/lib
87 $ cargo build --features testing_only_docs
94 Input C/C++ test headers reside in the `bindgen-tests/tests/headers` directory. Expected
95 output Rust bindings live in `bindgen-tests/tests/expectations/tests`. For example,
96 `bindgen-tests/tests/headers/my_header.h`'s expected generated Rust bindings would be
97 `bindgen-tests/tests/expectations/tests/my_header.rs`.
99 There are also some integration tests in the `./bindgen-integration` crate, which uses `bindgen` to
103 The generated and expected bindings are run through `rustfmt` before they are
108 $ rustup component add rustfmt --toolchain nightly
117 To regenerate bindings from the corpus of test headers in `bindgen-tests/tests/headers` and
118 compare them against the expected bindings in `bindgen-tests/tests/expectations/tests`, run:
141 `BINDGEN_DISABLE_ROUNDTRIP_TEST` to avoid a lot of tests for round-tripping of
147 `bindgen-tests/tests/expectations/tests/*` bindings files, then you should test that the
154 $ cd bindgen-tests/tests/expectations
161 is a dependency for running `test-one.sh`.
165 tests). This can be done with the `bindgen-tests/tests/test-one.sh` script. It supports fuzzy
170 $ ./bindgen-tests/tests/test-one.sh going
173 Note that `test-one.sh` does not recompile `bindgen`, so if you change the code,
174 you'll need to rebuild it before running the script again.
178 To add a new test header to the suite, simply put it in the `bindgen-tests/tests/headers`
180 bindings. Put those in `bindgen-tests/tests/expectations/tests`.
188 // bindgen-flags: --enable-cxx-namespaces -- -std=c++14
194 $ cd bindgen-tests/tests/expectations
203 version. Instead of having a single `bindgen-tests/tests/expectations/tests/my_test.rs` file,
206 * `bindgen-tests/tests/expectations/tests/libclang-9/my_test.rs`
207 * `bindgen-tests/tests/expectations/tests/libclang-5/my_test.rs`
211 many version of `libclang` installed locally. Just make a work-in-progress pull
216 Usually, `bindgen`'s test runner can infer which version of `libclang` you
221 $ cargo test --features testing_only_libclang_$VERSION
234 The `./bindgen-integration` crate uses `bindgen` to
241 $ cd bindgen-integration
251 See [./csmith-fuzzing/README.md](./csmith-fuzzing/README.md) for details.
267 Rust-y wrappers over the raw C `libclang` API that the `clang-sys` crate
311 The IR forms a graph of interconnected and inter-referencing types and
321 `src/ir/analysis/*`. They are implemented as fixed-point algorithms, using the
326 { ... }` macro for quasi-quoting Rust forms. Some options that affect the
334 - Introduce a new field to `BindgenOptions` for the option.
335 - Write a free function inside `codegen::postprocessing` implementing the
337 - Add a new value to the `codegen::postprocessing::PASSES` for the option using
346 All pull requests undergo code review before merging. To request review, comment
358 * [Servo's GitHub Workflow](https://github.com/servo/servo/wiki/Github-workflow)
359 …sing and Squashing](https://github.com/servo/servo/wiki/Beginner's-guide-to-rebasing-and-squashing)
376 Then, use the `--emit-ir-graphviz` flag to generate a `dot` file from our IR:
379 $ cargo run -- example.hpp --emit-ir-graphviz output.dot
385 $ dot -Tpng output.dot -o output.png
390 [](./example-graphviz-ir.png)
427 Otherwise, follow [these instructions](https://github.com/csmith-project/creduce/blob/main/INSTALL.…
433 2. A script to act as a predicate script describing whether the behavior you're
438 $ creduce ./predicate.sh ./isolated-test-case.h
443 `--dump-preprocessed-input` flag.
453 ### Writing a Predicate Script
455 Writing a `predicate.sh` script for a `bindgen` test case is straightforward. We
456 already have a general purpose predicate script that you can use, you just have
462 # Exit the script with a nonzero exit code if:
465 set -eu
467 # Invoke the general purpose predicate script that comes in the
470 # You'll need to replace `--whatever-flags` with things that are specific to the
472 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
473 --whatever-flags \
474 ./isolated-test-case.h
481 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
482 --expect-bindgen-fail \
483 --bindgen-grep "thread main panicked at '<insert panic message here>'" \
484 ./isolated-test-case.h
492 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
493 --bindings-grep NameOfTheStructThatIsErroneouslyDerivingEq \
494 --expect-compile-fail \
495 --rustc-grep 'error[E0277]: the trait bound `f64: std::cmp::Eq` is not satisfied' \
496 ./isolated-test-case.h
503 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
504 --bindings-grep MyStruct \
505 --expect-layout-tests-fail \
506 --layout-tests-grep "thread 'bindgen_test_layout_MyStruct' panicked" \
507 ./isolated-test-case.h
513 $ path/to/rust-bindgen/csmith-fuzzing/predicate.py --help
516 And you can always write your own, arbitrary predicate script if you prefer.
517 (Although, maybe we should add extra functionality to `predicate.py` -- file an
537 $ git log --oneline v0.62.0..HEAD
540 Also worth checking the [next-release tag](https://github.com/rust-lang/rust-bindgen/pulls?q=is%3Ap…
542 Once that's done and the changelog is up-to-date, run `doctoc` on it.
558 For regular releases, the changes above should end up in `main` before
559 publishing. For dot-releases of an old version (e.g., cherry-picking an
567 $ git tag -a v0.62.1 # With the right version of course
569 $ pushd bindgen-cli && cargo publish && popd
570 $ git push --tags upstream # To publish the tag