summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiran Ringel <liranringel@gmail.com>2017-10-11 01:02:58 +0200
committerLiran Ringel <liranringel@gmail.com>2017-10-11 02:35:17 +0200
commitd8f27ebba04c55454f54e00370ffde3b2db94c8c (patch)
tree01455008da07d155259611b9f77dfc459463d6d5
parentbd5f92867805fa4992b145ef4d820e28f3132ca7 (diff)
Make the default target for expectation files as x86_64-unknown-linux
-rw-r--r--tests/headers/call-conv-field.h2
-rw-r--r--tests/tests.rs17
2 files changed, 7 insertions, 12 deletions
diff --git a/tests/headers/call-conv-field.h b/tests/headers/call-conv-field.h
index 00ebd094..6fa5c46f 100644
--- a/tests/headers/call-conv-field.h
+++ b/tests/headers/call-conv-field.h
@@ -1,4 +1,4 @@
-// bindgen-flags: -- -target i686-pc-win32
+// bindgen-flags: -- --target=i686-pc-win32
// bindgen-unstable
// bindgen-generate-bindings-on-linux-only
//
diff --git a/tests/tests.rs b/tests/tests.rs
index 1e02da2d..df794b64 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -235,18 +235,13 @@ fn create_bindgen_builder(header: &PathBuf) -> Result<Option<Builder>, Error> {
}
}
- // Windows platform has various different conventions than *nix platforms,
- // e.g. default enum underlying type, struct padding, mangling. Most tests
- // were written and checked on Linux and macOS, and thus they could fail on
- // Windows. We just make those tests targetting Linux instead as far as one
- // isn't annotated for a specific target.
- if cfg!(target_os = "windows") {
- if flags.iter().all(|flag| !flag.starts_with("--target=")) {
- if !flags.iter().any(|flag| flag == "--") {
- flags.push("--".into());
- }
- flags.push("--target=x86_64-unknown-linux".into());
+ // Different platforms have various different conventions like struct padding, mangling, etc.
+ // We make the default target as x86_64-unknown-linux
+ if flags.iter().all(|flag| !flag.starts_with("--target=")) {
+ if !flags.iter().any(|flag| flag == "--") {
+ flags.push("--".into());
}
+ flags.push("--target=x86_64-unknown-linux".into());
}
// Fool builder_from_flags() into believing it has real env::args_os...