File tree 7 files changed +71
-20
lines changed 7 files changed +71
-20
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,9 @@ cache:
25
25
before_install : . ./ci/before_install.sh
26
26
27
27
script :
28
- - cargo test --features "$BINDGEN_FEATURES assert_no_dangling_items"
29
- - cargo test --release --features "$BINDGEN_FEATURES assert_no_dangling_items"
30
- - git add -A
31
- - git diff @
32
- - git diff-index --quiet HEAD
33
- - cargo build --features "$BINDGEN_FEATURES docs_"
34
- - cd tests/expectations
35
- - cargo test
36
- - cd ../../bindgen-integration
37
- - cargo test --features "$BINDGEN_FEATURES"
38
- - cargo test --release --features "$BINDGEN_FEATURES"
28
+ - ./ci/assert-rustfmt.sh
29
+ - BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/assert-docs.sh
30
+ - BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/test.sh
39
31
40
32
notifications :
41
33
webhooks : http://build.servo.org:54856/travis
Original file line number Diff line number Diff line change @@ -114,24 +114,26 @@ $ cargo test -p tests_expectations
114
114
115
115
## Automatic code formatting
116
116
117
- There's a ` rustfmt.toml ` file in the repo. Ideally changes should be consistent
118
- with the style, though that's not enforced right now.
117
+ We use [ ` rustfmt ` ] ( https://github.com/rust-lang-nursery/rustfmt ) to enforce a
118
+ consistent code style across the whole ` bindgen ` code base. This is enforced in
119
+ CI, and your pull requests will get automatically rejected if you don't
120
+ re-format with the latest ` rustfmt ` before pushing.
119
121
120
- [ ` rustfmt ` ] ( https://github.com/rust-lang-nursery/rustfmt ) can catch and fix
121
- automatically all the coding style issues it finds. In order to use it it
122
- suffices to do:
122
+ You can install the latest version of ` rustfmt ` with this command:
123
123
124
124
```
125
- $ cargo fmt
125
+ $ cargo install -f rustfmt
126
126
```
127
127
128
- For it to work, you need to have ` rustfmt ` installed. To do so:
128
+ Ensure that ` ~/.cargo/bin ` is on your path.
129
+
130
+ Once that is taken care of, you can (re)format all code by running this command:
129
131
130
132
```
131
- $ cargo install rustfmt
133
+ $ cargo fmt
132
134
```
133
135
134
- And ensure ` ~/.cargo/bin ` is on your path .
136
+ The code style is described in the ` rustfmt.toml ` file in top level of the repo .
135
137
136
138
## Debug Logging
137
139
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -xeu
4
+ cd " $( dirname " $0 " ) /.."
5
+
6
+ cargo build --features " $BINDGEN_FEATURES docs_"
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -xeu
4
+ cd " $( dirname " $0 " ) /.."
5
+
6
+ git add -u
7
+ git diff @
8
+ git diff-index --quiet HEAD
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -xeu
4
+ cd " $( dirname " $0 " ) /.."
5
+
6
+ # Ensure we have the most up-to-date `rustfmt`.
7
+ cargo install -f rustfmt
8
+
9
+ # Run `rustfmt` on the crate! If `rustfmt` can't make a long line shorter, it
10
+ # prints an error and exits non-zero, so tell it to kindly shut its yapper and
11
+ # make sure it doesn't cause us to exit this whole script non-zero.
12
+ cargo fmt --quiet || true
13
+
14
+ # Exit non-zero if this resulted in any diffs.
15
+ ./ci/assert-no-diff.sh
16
+
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -xeu
4
+ cd " $( dirname " $0 " ) /.."
5
+
6
+ # Regenerate the test headers' bindings in debug and release modes, and assert
7
+ # that we always get the expected generated bindings.
8
+
9
+ cargo test --features " $BINDGEN_FEATURES assert_no_dangling_items"
10
+ ./ci/assert-no-diff.sh
11
+
12
+ cargo test --release --features " $BINDGEN_FEATURES assert_no_dangling_items"
13
+ ./ci/assert-no-diff.sh
14
+
15
+ # Now test the expectations' size and alignment tests.
16
+
17
+ pushd tests/expectations
18
+ cargo test
19
+ cargo test --release
20
+ popd
21
+
22
+ # And finally, test our example bindgen + build.rs integration template project.
23
+
24
+ cd bindgen-integration
25
+ cargo test --features " $BINDGEN_FEATURES "
26
+ cargo test --release --features " $BINDGEN_FEATURES "
Original file line number Diff line number Diff line change 1
1
//! Objective C types
2
2
3
3
// use clang_sys::CXCursor_ObjCSuperClassRef;
4
+
4
5
use super :: context:: BindgenContext ;
5
6
use clang;
6
7
use clang_sys:: CXChildVisit_Continue ;
You can’t perform that action at this time.
0 commit comments