From 5e34f0ab9b27bb6e8c43ccaf507614b3bb45bf63 Mon Sep 17 00:00:00 2001 From: faineance Date: Thu, 9 Feb 2017 22:21:45 +0000 Subject: [PATCH 1/5] rename llvm_stable feature, and remove references from docs --- .travis.yml | 2 +- CONTRIBUTING.md | 2 +- Cargo.toml | 2 +- bindgen-integration/Cargo.toml | 2 +- src/main.rs | 2 +- tests/tests.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4dd55c86ef..b3d8456243 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ rust: - stable env: - - CARGO_TARGET_DIR=/tmp/bindgen LLVM_VERSION=3.8 BINDGEN_FEATURES=llvm_stable + - CARGO_TARGET_DIR=/tmp/bindgen LLVM_VERSION=3.8 BINDGEN_FEATURES=__testing_only_llvm_stable - CARGO_TARGET_DIR=/tmp/bindgen LLVM_VERSION=3.9 BINDGEN_FEATURES= cache: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ee1b4ac33..a42bec24df 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,7 +90,7 @@ Run `cargo test` to compare generated Rust bindings to the expectations. ### Running All Tests ``` -$ cargo test [--features llvm_stable] +$ cargo test ``` ### Authoring New Tests diff --git a/Cargo.toml b/Cargo.toml index d108c2c9ad..7f505bbe16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ version = "0.29" [features] assert_no_dangling_items = [] default = ["logging"] -llvm_stable = [] +__testing_only_llvm_stable = [] logging = ["env_logger", "log"] static = [] # This feature only exists for CI -- don't use it! diff --git a/bindgen-integration/Cargo.toml b/bindgen-integration/Cargo.toml index 9b8e341d7b..2aeec28ab9 100644 --- a/bindgen-integration/Cargo.toml +++ b/bindgen-integration/Cargo.toml @@ -11,4 +11,4 @@ bindgen = { path = ".." } gcc = "0.3" [features] -llvm_stable = ["bindgen/llvm_stable"] +__testing_only_llvm_stable = ["bindgen/__testing_only_llvm_stable"] diff --git a/src/main.rs b/src/main.rs index 68f3d0a865..2b18f1ab0d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ pub fn main() { let bind_args: Vec<_> = env::args().collect(); let version = clang_version(); - let expected_version = if cfg!(feature = "llvm_stable") { + let expected_version = if cfg!(feature = "__testing_only_llvm_stable") { (3, 8) } else { (3, 9) diff --git a/tests/tests.rs b/tests/tests.rs index ab1c00c3de..f1d229c563 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -84,7 +84,7 @@ fn create_bindgen_builder(header: &PathBuf) -> Result, Error> { .unwrap(); flags.extend(extra_flags.into_iter()); } else if line.contains("bindgen-unstable") && - cfg!(feature = "llvm_stable") { + cfg!(feature = "__testing_only_llvm_stable") { return Ok(None); } else if line.contains("bindgen-osx-only") { let prepend_flags = ["--raw-line", "#![cfg(target_os=\"macos\")]"]; From 979452b7b89653b7373b668eff8ebfc7c8dc5953 Mon Sep 17 00:00:00 2001 From: faineance Date: Thu, 9 Feb 2017 22:23:04 +0000 Subject: [PATCH 2/5] test command in contributing --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a42bec24df..3720842631 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,7 +90,7 @@ Run `cargo test` to compare generated Rust bindings to the expectations. ### Running All Tests ``` -$ cargo test +$ cargo test --all-features ``` ### Authoring New Tests From 0a897c91b6d4989a5566003408733a98b8fa82f5 Mon Sep 17 00:00:00 2001 From: faineance Date: Thu, 9 Feb 2017 22:25:33 +0000 Subject: [PATCH 3/5] fix contributing --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3720842631..328b08705c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ that you aren't forgetting to document types and functions. CI will catch it if you forget, but the turn around will be a lot slower ;) ``` -$ cargo build --features "llvm_stable _docs" +$ cargo build --features _docs ``` ## Testing @@ -90,7 +90,7 @@ Run `cargo test` to compare generated Rust bindings to the expectations. ### Running All Tests ``` -$ cargo test --all-features +$ cargo test [--all-features] ``` ### Authoring New Tests From bb98fbcc687f2420f0737d39dfa335b4af03e566 Mon Sep 17 00:00:00 2001 From: faineance Date: Thu, 9 Feb 2017 22:27:15 +0000 Subject: [PATCH 4/5] fix contributing instructions --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 328b08705c..cbaaf3c4ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ that you aren't forgetting to document types and functions. CI will catch it if you forget, but the turn around will be a lot slower ;) ``` -$ cargo build --features _docs +$ cargo build --features docs_ ``` ## Testing From 0db962b148e38cee515f1326ee9fcd4c97c143db Mon Sep 17 00:00:00 2001 From: faineance Date: Thu, 9 Feb 2017 22:31:55 +0000 Subject: [PATCH 5/5] remove underscore prefix from feature name --- .travis.yml | 2 +- Cargo.toml | 2 +- bindgen-integration/Cargo.toml | 2 +- src/main.rs | 2 +- tests/tests.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3d8456243..ba5ec867c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ rust: - stable env: - - CARGO_TARGET_DIR=/tmp/bindgen LLVM_VERSION=3.8 BINDGEN_FEATURES=__testing_only_llvm_stable + - CARGO_TARGET_DIR=/tmp/bindgen LLVM_VERSION=3.8 BINDGEN_FEATURES=testing_only_llvm_stable - CARGO_TARGET_DIR=/tmp/bindgen LLVM_VERSION=3.9 BINDGEN_FEATURES= cache: diff --git a/Cargo.toml b/Cargo.toml index 7f505bbe16..9ac60ed0b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ version = "0.29" [features] assert_no_dangling_items = [] default = ["logging"] -__testing_only_llvm_stable = [] +testing_only_llvm_stable = [] logging = ["env_logger", "log"] static = [] # This feature only exists for CI -- don't use it! diff --git a/bindgen-integration/Cargo.toml b/bindgen-integration/Cargo.toml index 2aeec28ab9..3b1083d4e3 100644 --- a/bindgen-integration/Cargo.toml +++ b/bindgen-integration/Cargo.toml @@ -11,4 +11,4 @@ bindgen = { path = ".." } gcc = "0.3" [features] -__testing_only_llvm_stable = ["bindgen/__testing_only_llvm_stable"] +testing_only_llvm_stable = ["bindgen/testing_only_llvm_stable"] diff --git a/src/main.rs b/src/main.rs index 2b18f1ab0d..ea3da06d4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ pub fn main() { let bind_args: Vec<_> = env::args().collect(); let version = clang_version(); - let expected_version = if cfg!(feature = "__testing_only_llvm_stable") { + let expected_version = if cfg!(feature = "testing_only_llvm_stable") { (3, 8) } else { (3, 9) diff --git a/tests/tests.rs b/tests/tests.rs index f1d229c563..6b69e0d42c 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -84,7 +84,7 @@ fn create_bindgen_builder(header: &PathBuf) -> Result, Error> { .unwrap(); flags.extend(extra_flags.into_iter()); } else if line.contains("bindgen-unstable") && - cfg!(feature = "__testing_only_llvm_stable") { + cfg!(feature = "testing_only_llvm_stable") { return Ok(None); } else if line.contains("bindgen-osx-only") { let prepend_flags = ["--raw-line", "#![cfg(target_os=\"macos\")]"];