diff options
-rw-r--r-- | .travis.yml | 20 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | appveyor.yml | 8 | ||||
-rw-r--r-- | bindgen-integration/Cargo.toml | 1 | ||||
-rw-r--r-- | ci/before_install.sh | 2 | ||||
-rw-r--r-- | src/main.rs | 25 | ||||
-rw-r--r-- | tests/expectations/build.rs | 2 | ||||
-rwxr-xr-x | tests/stylo_sanity.rs | 4 | ||||
-rw-r--r-- | tests/tests.rs | 8 |
9 files changed, 46 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml index 36e10e1a..58302008 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,21 +30,27 @@ env: - LLVM_VERSION="4.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE="--release" - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE= - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" - - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions" - - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions" - LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE= - LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release" - LLVM_VERSION="5.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE= - LLVM_VERSION="5.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE="--release" - - LLVM_VERSION="5.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE= - - LLVM_VERSION="5.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release" - - LLVM_VERSION="5.0" BINDGEN_JOB="misc" - - LLVM_VERSION="5.0" BINDGEN_JOB="quickchecking" + - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= + - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" + - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions" + - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions" + - LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE= + - LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release" + - LLVM_VERSION="9.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE= + - LLVM_VERSION="9.0" BINDGEN_JOB="nofeatures" BINDGEN_PROFILE="--release" + - LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE= + - LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release" + - LLVM_VERSION="9.0" BINDGEN_JOB="misc" + - LLVM_VERSION="9.0" BINDGEN_JOB="quickchecking" matrix: fast_finish: true allow_failures: - - env: LLVM_VERSION=5.0 BINDGEN_JOB=rustfmt + - env: LLVM_VERSION=9.0 BINDGEN_JOB=rustfmt cache: directories: @@ -81,6 +81,7 @@ which-rustfmt = ["which"] # on bindgen! testing_only_docs = [] testing_only_extra_assertions = [] +testing_only_libclang_9 = [] testing_only_libclang_5 = [] testing_only_libclang_4 = [] testing_only_libclang_3_9 = [] diff --git a/appveyor.yml b/appveyor.yml index 91009f68..342f47cc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,9 +8,12 @@ environment: - TARGET: gnu LLVM_VERSION: 4.0.0-1 BINDGEN_FEATURES: testing_only_libclang_4 - - TARGET: msvc + - TARGET: gnu LLVM_VERSION: 5.0.0-1 BINDGEN_FEATURES: testing_only_libclang_5 + - TARGET: gnu + LLVM_VERSION: 9.0.0-1 + BINDGEN_FEATURES: testing_only_libclang_9 - TARGET: msvc LLVM_VERSION: 3.9.0 BINDGEN_FEATURES: testing_only_libclang_3_9 @@ -20,6 +23,9 @@ environment: - TARGET: msvc LLVM_VERSION: 5.0.0 BINDGEN_FEATURES: testing_only_libclang_5 + - TARGET: msvc + LLVM_VERSION: 9.0.0 + BINDGEN_FEATURES: testing_only_libclang_9 configuration: - stable diff --git a/bindgen-integration/Cargo.toml b/bindgen-integration/Cargo.toml index 1cd69b9f..8f0cb1f9 100644 --- a/bindgen-integration/Cargo.toml +++ b/bindgen-integration/Cargo.toml @@ -11,6 +11,7 @@ bindgen = { path = ".." } cc = "1.0" [features] +testing_only_libclang_9 = ["bindgen/testing_only_libclang_9"] testing_only_libclang_5 = ["bindgen/testing_only_libclang_5"] testing_only_libclang_4 = ["bindgen/testing_only_libclang_4"] testing_only_libclang_3_9 = ["bindgen/testing_only_libclang_3_9"] diff --git a/ci/before_install.sh b/ci/before_install.sh index fcc00ea2..41b39771 100644 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -29,6 +29,8 @@ function llvm_version_triple() { echo "4.0.0" elif [ "$1" == "5.0" ]; then echo "5.0.0" + elif [ "$1" == "9.0" ]; then + echo "9.0.0" fi } diff --git a/src/main.rs b/src/main.rs index 5e22b1e6..2c32d3cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,23 +24,24 @@ pub fn main() { let bind_args: Vec<_> = env::args().collect(); let version = clang_version(); - let expected_version = if cfg!(feature = "testing_only_libclang_4") { - (4, 0) + let expected_version = if cfg!(feature = "testing_only_libclang_9") { + Some((9, 0)) + } else if cfg!(feature = "testing_only_libclang_5") { + Some((5, 0)) + } else if cfg!(feature = "testing_only_libclang_4") { + Some((4, 0)) + } else if cfg!(feature = "testing_only_libclang_3_9") { + Some((3, 9)) } else if cfg!(feature = "testing_only_libclang_3_8") { - (3, 8) + Some((3, 8)) } else { - // Default to 3.9. - (3, 9) + None }; - info!("Clang Version: {}", version.full); + info!("Clang Version: {}, parsed: {:?}", version.full, version.parsed); - match version.parsed { - None => warn!("Couldn't parse libclang version"), - Some(version) if version != expected_version => { - warn!("Using clang {:?}, expected {:?}", version, expected_version); - } - _ => {} + if expected_version.is_some() { + assert_eq!(version.parsed, version.parsed); } match builder_from_flags(bind_args.into_iter()) { diff --git a/tests/expectations/build.rs b/tests/expectations/build.rs index 4f5e5a5e..0aae10de 100644 --- a/tests/expectations/build.rs +++ b/tests/expectations/build.rs @@ -9,7 +9,7 @@ use std::io::Write; use std::path::Path; const LIBCLANG_VERSION_DIRS: &'static [&'static str] = - &["libclang-3.8", "libclang-3.9", "libclang-4", "libclang-5"]; + &["libclang-3.8", "libclang-3.9", "libclang-4", "libclang-5", "libclang-9"]; fn main() { println!("cargo:rerun-if-changed=build.rs"); diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs index 41d614a8..54fbb64e 100755 --- a/tests/stylo_sanity.rs +++ b/tests/stylo_sanity.rs @@ -21,7 +21,9 @@ extern crate bindgen; )))] #[cfg(any( feature = "testing_only_libclang_3_9", - feature = "testing_only_libclang_4" + feature = "testing_only_libclang_4", + feature = "testing_only_libclang_5", + feature = "testing_only_libclang_9" ))] fn sanity_check_can_generate_stylo_bindings() { use std::time::Instant; diff --git a/tests/tests.rs b/tests/tests.rs index 6046cd83..f0fc9ff6 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -117,10 +117,12 @@ fn compare_generated_header(header: &PathBuf, builder: Builder) -> Result<(), Er { let mut expectation = expectation.clone(); - if cfg!(feature = "testing_only_libclang_4") { - expectation.push("libclang-4"); + if cfg!(feature = "testing_only_libclang_9") { + expectation.push("libclang-9"); } else if cfg!(feature = "testing_only_libclang_5") { expectation.push("libclang-5"); + } else if cfg!(feature = "testing_only_libclang_4") { + expectation.push("libclang-4"); } else if cfg!(feature = "testing_only_libclang_3_9") { expectation.push("libclang-3.9"); } else if cfg!(feature = "testing_only_libclang_3_8") { @@ -134,7 +136,7 @@ fn compare_generated_header(header: &PathBuf, builder: Builder) -> Result<(), Er "9".to_owned() } else if maj >= 5 { "5".to_owned() - } else if maj == 4 { + } else if maj >= 4 { "4".to_owned() } else { format!("{}.{}", maj, min) |