summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml14
-rwxr-xr-xci/assert-docs.sh6
-rwxr-xr-xci/assert-no-diff.sh8
-rwxr-xr-xci/assert-rustfmt.sh16
-rwxr-xr-xci/test.sh26
-rw-r--r--src/ir/objc.rs1
6 files changed, 60 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
index 47af4eeb..aaa4b2e6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,17 +25,9 @@ cache:
before_install: . ./ci/before_install.sh
script:
- - cargo test --features "$BINDGEN_FEATURES assert_no_dangling_items"
- - cargo test --release --features "$BINDGEN_FEATURES assert_no_dangling_items"
- - git add -A
- - git diff @
- - git diff-index --quiet HEAD
- - cargo build --features "$BINDGEN_FEATURES docs_"
- - cd tests/expectations
- - cargo test
- - cd ../../bindgen-integration
- - cargo test --features "$BINDGEN_FEATURES"
- - cargo test --release --features "$BINDGEN_FEATURES"
+ - ./ci/assert-rustfmt.sh
+ - ./ci/assert-docs.sh
+ - ./ci/test.sh
notifications:
webhooks: http://build.servo.org:54856/travis
diff --git a/ci/assert-docs.sh b/ci/assert-docs.sh
new file mode 100755
index 00000000..aa4b90ac
--- /dev/null
+++ b/ci/assert-docs.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+set -xeu
+cd "$(dirname "$0")/.."
+
+cargo build --features "$BINDGEN_FEATURES docs_"
diff --git a/ci/assert-no-diff.sh b/ci/assert-no-diff.sh
new file mode 100755
index 00000000..14f2aa21
--- /dev/null
+++ b/ci/assert-no-diff.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+set -xeu
+cd "$(dirname "$0")/.."
+
+git add -u
+git diff @
+git diff-index --quiet HEAD
diff --git a/ci/assert-rustfmt.sh b/ci/assert-rustfmt.sh
new file mode 100755
index 00000000..bd268600
--- /dev/null
+++ b/ci/assert-rustfmt.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+set -xeu
+cd "$(dirname "$0")/.."
+
+# Ensure we have the most up-to-date `rustfmt`.
+cargo install -f rustfmt
+
+# Run `rustfmt` on the crate! If `rustfmt` can't make a long line shorter, it
+# prints an error and exits non-zero, so tell it to kindly shut its yapper and
+# make sure it doesn't cause us to exit this whole script non-zero.
+cargo fmt --quiet || true
+
+# Exit non-zero if this resulted in any diffs.
+./ci/assert-no-diff.sh
+
diff --git a/ci/test.sh b/ci/test.sh
new file mode 100755
index 00000000..9bfccfd8
--- /dev/null
+++ b/ci/test.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+set -xeu
+cd "$(dirname "$0")/.."
+
+# Regenerate the test headers' bindings in debug and release modes, and assert
+# that we always get the expected generated bindings.
+
+cargo test --features "$BINDGEN_FEATURES assert_no_dangling_items"
+./ci/assert-no-diff.sh
+
+cargo test --release --features "$BINDGEN_FEATURES assert_no_dangling_items"
+./ci/assert-no-diff.sh
+
+# Now test the expectations' size and alignment tests.
+
+pushd tests/expectations
+cargo test
+cargo test --release
+popd
+
+# And finally, test our example bindgen + build.rs integration template project.
+
+cd bindgen-integration
+cargo test --features "$BINDGEN_FEATURES"
+cargo test --release --features "$BINDGEN_FEATURES"
diff --git a/src/ir/objc.rs b/src/ir/objc.rs
index 92356d92..08cab1cc 100644
--- a/src/ir/objc.rs
+++ b/src/ir/objc.rs
@@ -1,6 +1,7 @@
//! Objective C types
// use clang_sys::CXCursor_ObjCSuperClassRef;
+
use super::context::BindgenContext;
use clang;
use clang_sys::CXChildVisit_Continue;