Skip to content

Commit 497ae94

Browse files
committed
Speed up integration tests (move building expectations)
Speed up running 'cargo test': -Before: 2'17s -After: 30s For every 'cargo test' run, the bindgen output where built. We already test that the bindgen output match expectations/*.rs, so there is no need to check it build unless the expectation is updated. Move tests/expectations/*.rs to tests/expectations/tests/*.rs and make tests/expectations a new dev-dependency package. This allow running: - cargo test -p tests_expectations In addition to the speed up, we also get a clean output for the build and test run. In particular, a number of warnings are generated that should probably be silenced, and eventually enforced modifying travis to build: - RUSTFLAGS='-D warnings' cargo test -p tests_expectations The benefit of having it as a new package is that it avoid polluting the 'cargo test' output that should focus on bindgen.
1 parent 9073a4f commit 497ae94

File tree

116 files changed

+16
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+16
-80
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ script:
3333
- git add -A
3434
- git diff @
3535
- git diff-index --quiet HEAD
36+
- cargo test -p tests_expectations
3637
- cargo build --features "$BINDGEN_FEATURES _docs"
3738

3839
notifications:

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,8 @@ _docs = []
5454
name = "bindgen"
5555
path = "src/lib.rs"
5656

57+
[dev-dependencies.tests_expectations]
58+
path = "tests/expectations"
59+
5760
[[test]]
5861
name = "tests"

tests/expectations/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "tests_expectations"
3+
description = "bindgen results when ran on ../headers/*"
4+
version = "0.1.0"
5+
authors = [
6+
"Jyun-Yan You <[email protected]>",
7+
"Emilio Cobos Álvarez <[email protected]>",
8+
"The Servo project developers",
9+
]
10+
11+
[dependencies]

tests/expectations/moar_bitfields.rs

Lines changed: 0 additions & 48 deletions
This file was deleted.

tests/expectations/src/lib.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)