Skip to content

Commit cd4f004

Browse files
committed
Add llvm 9.0 to CI.
1 parent 5591a10 commit cd4f004

File tree

9 files changed

+46
-25
lines changed

9 files changed

+46
-25
lines changed

.travis.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,27 @@ env:
3030
- LLVM_VERSION="4.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE="--release"
3131
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
3232
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
33-
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
34-
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"
3533
- LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
3634
- LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
3735
- LLVM_VERSION="5.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE=
3836
- LLVM_VERSION="5.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE="--release"
39-
- LLVM_VERSION="5.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
40-
- LLVM_VERSION="5.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
41-
- LLVM_VERSION="5.0" BINDGEN_JOB="misc"
42-
- LLVM_VERSION="5.0" BINDGEN_JOB="quickchecking"
37+
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
38+
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
39+
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
40+
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"
41+
- LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
42+
- LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
43+
- LLVM_VERSION="9.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE=
44+
- LLVM_VERSION="9.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE="--release"
45+
- LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
46+
- LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
47+
- LLVM_VERSION="9.0" BINDGEN_JOB="misc"
48+
- LLVM_VERSION="9.0" BINDGEN_JOB="quickchecking"
4349

4450
matrix:
4551
fast_finish: true
4652
allow_failures:
47-
- env: LLVM_VERSION=5.0 BINDGEN_JOB=rustfmt
53+
- env: LLVM_VERSION=9.0 BINDGEN_JOB=rustfmt
4854

4955
cache:
5056
directories:

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ which-rustfmt = ["which"]
8181
# on bindgen!
8282
testing_only_docs = []
8383
testing_only_extra_assertions = []
84+
testing_only_libclang_9 = []
8485
testing_only_libclang_5 = []
8586
testing_only_libclang_4 = []
8687
testing_only_libclang_3_9 = []

appveyor.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ environment:
88
- TARGET: gnu
99
LLVM_VERSION: 4.0.0-1
1010
BINDGEN_FEATURES: testing_only_libclang_4
11-
- TARGET: msvc
11+
- TARGET: gnu
1212
LLVM_VERSION: 5.0.0-1
1313
BINDGEN_FEATURES: testing_only_libclang_5
14+
- TARGET: gnu
15+
LLVM_VERSION: 9.0.0-1
16+
BINDGEN_FEATURES: testing_only_libclang_9
1417
- TARGET: msvc
1518
LLVM_VERSION: 3.9.0
1619
BINDGEN_FEATURES: testing_only_libclang_3_9
@@ -20,6 +23,9 @@ environment:
2023
- TARGET: msvc
2124
LLVM_VERSION: 5.0.0
2225
BINDGEN_FEATURES: testing_only_libclang_5
26+
- TARGET: msvc
27+
LLVM_VERSION: 9.0.0
28+
BINDGEN_FEATURES: testing_only_libclang_9
2329

2430
configuration:
2531
- stable

bindgen-integration/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ bindgen = { path = ".." }
1111
cc = "1.0"
1212

1313
[features]
14+
testing_only_libclang_9 = ["bindgen/testing_only_libclang_9"]
1415
testing_only_libclang_5 = ["bindgen/testing_only_libclang_5"]
1516
testing_only_libclang_4 = ["bindgen/testing_only_libclang_4"]
1617
testing_only_libclang_3_9 = ["bindgen/testing_only_libclang_3_9"]

ci/before_install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function llvm_version_triple() {
2929
echo "4.0.0"
3030
elif [ "$1" == "5.0" ]; then
3131
echo "5.0.0"
32+
elif [ "$1" == "9.0" ]; then
33+
echo "9.0.0"
3234
fi
3335
}
3436

src/main.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,24 @@ pub fn main() {
2424
let bind_args: Vec<_> = env::args().collect();
2525

2626
let version = clang_version();
27-
let expected_version = if cfg!(feature = "testing_only_libclang_4") {
28-
(4, 0)
27+
let expected_version = if cfg!(feature = "testing_only_libclang_9") {
28+
Some((9, 0))
29+
} else if cfg!(feature = "testing_only_libclang_5") {
30+
Some((5, 0))
31+
} else if cfg!(feature = "testing_only_libclang_4") {
32+
Some((4, 0))
33+
} else if cfg!(feature = "testing_only_libclang_3_9") {
34+
Some((3, 9))
2935
} else if cfg!(feature = "testing_only_libclang_3_8") {
30-
(3, 8)
36+
Some((3, 8))
3137
} else {
32-
// Default to 3.9.
33-
(3, 9)
38+
None
3439
};
3540

36-
info!("Clang Version: {}", version.full);
41+
info!("Clang Version: {}, parsed: {:?}", version.full, version.parsed);
3742

38-
match version.parsed {
39-
None => warn!("Couldn't parse libclang version"),
40-
Some(version) if version != expected_version => {
41-
warn!("Using clang {:?}, expected {:?}", version, expected_version);
42-
}
43-
_ => {}
43+
if expected_version.is_some() {
44+
assert_eq!(version.parsed, version.parsed);
4445
}
4546

4647
match builder_from_flags(bind_args.into_iter()) {

tests/expectations/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::io::Write;
99
use std::path::Path;
1010

1111
const LIBCLANG_VERSION_DIRS: &'static [&'static str] =
12-
&["libclang-3.8", "libclang-3.9", "libclang-4", "libclang-5"];
12+
&["libclang-3.8", "libclang-3.9", "libclang-4", "libclang-5", "libclang-9"];
1313

1414
fn main() {
1515
println!("cargo:rerun-if-changed=build.rs");

tests/stylo_sanity.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ extern crate bindgen;
2121
)))]
2222
#[cfg(any(
2323
feature = "testing_only_libclang_3_9",
24-
feature = "testing_only_libclang_4"
24+
feature = "testing_only_libclang_4",
25+
feature = "testing_only_libclang_5",
26+
feature = "testing_only_libclang_9"
2527
))]
2628
fn sanity_check_can_generate_stylo_bindings() {
2729
use std::time::Instant;

tests/tests.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ fn compare_generated_header(header: &PathBuf, builder: Builder) -> Result<(), Er
117117
{
118118
let mut expectation = expectation.clone();
119119

120-
if cfg!(feature = "testing_only_libclang_4") {
121-
expectation.push("libclang-4");
120+
if cfg!(feature = "testing_only_libclang_9") {
121+
expectation.push("libclang-9");
122122
} else if cfg!(feature = "testing_only_libclang_5") {
123123
expectation.push("libclang-5");
124+
} else if cfg!(feature = "testing_only_libclang_4") {
125+
expectation.push("libclang-4");
124126
} else if cfg!(feature = "testing_only_libclang_3_9") {
125127
expectation.push("libclang-3.9");
126128
} else if cfg!(feature = "testing_only_libclang_3_8") {
@@ -134,7 +136,7 @@ fn compare_generated_header(header: &PathBuf, builder: Builder) -> Result<(), Er
134136
"9".to_owned()
135137
} else if maj >= 5 {
136138
"5".to_owned()
137-
} else if maj == 4 {
139+
} else if maj >= 4 {
138140
"4".to_owned()
139141
} else {
140142
format!("{}.{}", maj, min)

0 commit comments

Comments
 (0)