Skip to content

Commit 4ab18e6

Browse files
author
bors-servo
authored
Auto merge of #176 - fitzgen:release-tests, r=emilio
Run tests on release builds This makes `cargo test` test the appropriate release/debug bindgen binary and extends Travis CI testing to also test release builds. r? @emilio
2 parents 41b9f69 + bc99e3f commit 4ab18e6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ before_script:
4141
script:
4242
- cargo build --verbose --features llvm_stable
4343
- cargo test --features llvm_stable
44+
- cargo build --release --verbose --features llvm_stable
45+
- cargo test --release --features llvm_stable
4446
- git add -A
4547
- git diff @
4648
- git diff-index --quiet HEAD

tests/tests.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ fn run_bindgen_tests() {
6464

6565
let mut bindgen = PathBuf::from(&crate_root);
6666
bindgen.push("target");
67-
bindgen.push("debug");
67+
if cfg!(debug_assertions) {
68+
bindgen.push("debug");
69+
} else {
70+
bindgen.push("release");
71+
}
6872
bindgen.push("bindgen");
6973
if !bindgen.is_file() {
7074
panic!("{} is not a file! Build bindgen before running tests.",

0 commit comments

Comments
 (0)