• Home
  • Raw
  • Download

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 - [Prerequisites](#prerequisites)
15 - [`rustfmt` / `cargo fmt`](#rustfmt--cargo-fmt)
16 - [Building](#building)
17 - [Testing](#testing)
18 - [Overview](#overview)
19 - [Testing Bindings Generation](#testing-bindings-generation)
20 - [Testing Generated Bindings](#testing-generated-bindings)
21- [Testing a Single Header's Bindings Generation and Compiling its Bindings](#testing-a-single-hea…
22 - [Authoring New Tests](#authoring-new-tests)
23 - [Test Expectations and `libclang` Versions](#test-expectations-and-libclang-versions)
24 - [Integration Tests](#integration-tests)
25 - [Fuzzing `bindgen` with `csmith`](#fuzzing-bindgen-with-csmith)
26- [Property tests for `bindgen` with `quickchecking`](#property-tests-for-bindgen-with-quickchecki…
27 - [Code Overview](#code-overview)
28 - [Implementing new options using `syn`](#implementing-new-options-using-syn)
29 - [Pull Requests and Code Reviews](#pull-requests-and-code-reviews)
30 - [Generating Graphviz Dot Files](#generating-graphviz-dot-files)
31 - [Debug Logging](#debug-logging)
32 - [Using `creduce` to Minimize Test Cases](#using-creduce-to-minimize-test-cases)
33 - [Getting `creduce`](#getting-creduce)
34 - [Isolating Your Test Case](#isolating-your-test-case)
35 - [Writing a Predicate Script](#writing-a-predicate-script)
36 - [Cutting a new bindgen release](#cutting-a-new-bindgen-release)
37 - [Updating the changelog](#updating-the-changelog)
38 - [Merge to `main`](#merge-to-main)
39 - [Tag and publish](#tag-and-publish)
40 - [Create a new release on Github](#create-a-new-release-on-github)
41 - [What to do if a Github release fails](#what-to-do-if-a-github-release-fails)
42 - [Create a new crates.io release](#create-a-new-cratesio-release)
44 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
50 [coc]: https://www.rust-lang.org/policies/code-of-conduct
61 * The [debugging logs](#debug-logging) generated when running `bindgen` on this testcase
65 …[Issues labeled "easy"](https://github.com/rust-lang/rust-bindgen/issues?q=is%3Aopen+is%3Aissue+la…
66 …labeled "less easy"](https://github.com/rust-lang/rust-bindgen/issues?q=is%3Aopen+is%3Aissue+label…
67 * [Issues labeled "help wanted"](https://github.com/rust-lang/rust-bindgen/labels/help%20wanted)
68 * Still can't find something to work on? [Drop a comment here](https://github.com/rust-lang/rust-bi…
77 For rust-analyzer, you can set `rustfmt.extraArgs = ['+nightly']`.
79 To check via command line, you can run `cargo +nightly fmt --check`.
94 $ export LIBCLANG_PATH=path/to/clang-9.0/lib
101 Input C/C++ test headers reside in the `bindgen-tests/tests/headers` directory. Expected
102 output Rust bindings live in `bindgen-tests/tests/expectations/tests`. For example,
103 `bindgen-tests/tests/headers/my_header.h`'s expected generated Rust bindings would be
104 `bindgen-tests/tests/expectations/tests/my_header.rs`.
106 There are also some integration tests in the `./bindgen-integration` crate, which uses `bindgen` to
110 The generated and expected bindings are formatted with [prettyplease] before they are
113 (if you built `bindgen` with the `--no-default-features` option of Cargo).
114 Note also that `rustfmt` formatting is disabled for the `bindgen-tests/tests/expectations/`
124 To regenerate bindings from the corpus of test headers in `bindgen-tests/tests/headers` and
125 compare them against the expected bindings in `bindgen-tests/tests/expectations/tests`, run:
148 `BINDGEN_DISABLE_ROUNDTRIP_TEST` to avoid a lot of tests for round-tripping of
154 `bindgen-tests/tests/expectations/tests/*` bindings files, then you should test that the
161 $ cd bindgen-tests/tests/expectations
168 is a dependency for running `test-one.sh`.
172 tests). This can be done with the `bindgen-tests/tests/test-one.sh` script. It supports fuzzy
177 $ ./bindgen-tests/tests/test-one.sh going
180 Note that `test-one.sh` does not recompile `bindgen`, so if you change the code,
181 you'll need to rebuild it before running the script again.
185 To add a new test header to the suite, simply put it in the `bindgen-tests/tests/headers`
187 bindings. Put those in `bindgen-tests/tests/expectations/tests`.
195 // bindgen-flags: --enable-cxx-namespaces -- -std=c++14
201 $ cd bindgen-tests/tests/expectations
210 version. Instead of having a single `bindgen-tests/tests/expectations/tests/my_test.rs` file,
213 * `bindgen-tests/tests/expectations/tests/libclang-16/my_test.rs`
214 * `bindgen-tests/tests/expectations/tests/libclang-9/my_test.rs`
218 many versions of `libclang` installed locally. Just make a work-in-progress pull
223 Usually, `bindgen`'s test runner can infer which version of `libclang` you
228 $ cargo test --features __testing_only_libclang_$VERSION
235 The `./bindgen-integration` crate uses `bindgen` to
242 $ cd bindgen-integration
252 See [./csmith-fuzzing/README.md](./csmith-fuzzing/README.md) for details.
268 Rust-y wrappers over the raw C `libclang` API that the `clang-sys` crate
312 The IR forms a graph of interconnected and inter-referencing types and
322 `src/ir/analysis/*`. They are implemented as fixed-point algorithms, using the
327 { ... }` macro for quasi-quoting Rust forms. Some options that affect the
335 - Introduce a new field to `BindgenOptions` for the option.
336 - Write a free function inside `codegen::postprocessing` implementing the
338 - Add a new value to the `codegen::postprocessing::PASSES` for the option using
347 All pull requests undergo code review before merging. To request review, comment
359 * [Servo's GitHub Workflow](https://github.com/servo/servo/wiki/Github-workflow)
360 …sing and Squashing](https://github.com/servo/servo/wiki/Beginner's-guide-to-rebasing-and-squashing)
377 Then, use the `--emit-ir-graphviz` flag to generate a `dot` file from our IR:
380 $ cargo run -- example.hpp --emit-ir-graphviz output.dot
386 $ dot -Tpng output.dot -o output.png
391 [![An example graphviz rendering of our IR](./example-graphviz-ir.png)](./example-graphviz-ir.png)
428 Otherwise, follow [these instructions](https://github.com/csmith-project/creduce/blob/master/INSTAL…
434 2. A script to act as a predicate script describing whether the behavior you're
439 $ creduce ./predicate.sh ./isolated-test-case.h
444 `--dump-preprocessed-input` flag.
454 ### Writing a Predicate Script
456 Writing a `predicate.sh` script for a `bindgen` test case is straightforward. We
457 already have a general purpose predicate script that you can use, you just have
463 # Exit the script with a nonzero exit code if:
466 set -eu
468 # Invoke the general purpose predicate script that comes in the
471 # You'll need to replace `--whatever-flags` with things that are specific to the
473 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
474 --whatever-flags \
475 ./isolated-test-case.h
482 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
483 --expect-bindgen-fail \
484 --bindgen-grep "thread main panicked at '<insert panic message here>'" \
485 ./isolated-test-case.h
493 # the rustc-grep argument expects a regex, thus escape where necessary
494 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
495 --bindings-grep NameOfTheStructThatIsErroneouslyDerivingEq \
496 --expect-compile-fail \
497 --rustc-grep 'error\[E0277\]: the trait bound `f64: std::cmp::Eq` is not satisfied' \
498 ./isolated-test-case.h
505 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
506 --bindings-grep MyStruct \
507 --expect-layout-tests-fail \
508 --layout-tests-grep "thread 'bindgen_test_layout_MyStruct' panicked" \
509 ./isolated-test-case.h
515 $ path/to/rust-bindgen/csmith-fuzzing/predicate.py --help
518 And you can always write your own, arbitrary predicate script if you prefer.
519 (Although, maybe we should add extra functionality to `predicate.py` -- file an
539 $ git log --oneline v0.62.0..HEAD
542 Also worth checking the [next-release
543 tag](https://github.com/rust-lang/rust-bindgen/pulls?q=is%3Apr+label%3Anext-release).
550 For regular releases, the changes above should end up in `main` before
551 publishing. For dot-releases of an old version (e.g., cherry-picking an
563 cargo release [patch|minor] --no-publish --execute
568 - Bump the version.
569 - Turn the `Unreleased` section of the changelog into the section for the version being released.
570 - Update the table of contents of the changelog using `doctoc`.
571 - Tag (`git tag`) the HEAD commit
572 - Push (`git push`) to GitHub
576 - `patch` would bump __v0.68.1__ to __v0.68.2__
577 - `minor` would bump __v0.68.2__ to __v0.69.0__
580 > We use the `--no-publish` so that the crates are only published after the release is complete.
588 - when a Git tag is pushed
589 - when all tests succeed
601 when a new cargo-dist is available:
604 cargo dist init # from "cargo install cargo-dist"
611 by running `git tag -d`. Once all the extra changes are in the `main` branch,
613 using `git push --tag`.
618 workflow](https://github.com/rust-lang/rust-bindgen/actions/workflows/publish.yml)