Skip to content

Commit a2c41e5

Browse files
committed
Only run call-conv-field.h test on linux
This is a temporary work around for issue #593 and this test failing on MacOS because we don't currently handle when bindgen's target OS is not the same as the emitted bindings' target OS.
1 parent 50faeab commit a2c41e5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/headers/call-conv-field.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
// bindgen-flags: -- -target i686-pc-win32
22
// bindgen-unstable
3+
// bindgen-generate-bindings-on-linux-only
4+
//
5+
// The linux-only thing is a hack around our lack of understanding when
6+
// bindgen's target_os != the bindings' target_os :(
7+
//
8+
// https://github.com/servo/rust-bindgen/issues/593
39

410
struct JNINativeInterface_ {
511
int (__stdcall *GetVersion)(void *env);

tests/tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ fn create_bindgen_builder(header: &PathBuf) -> Result<Option<Builder>, Error> {
9292
.map(ToString::to_string)
9393
.chain(flags)
9494
.collect();
95+
} else if line.contains("bindgen-generate-bindings-on-linux-only") &&
96+
!cfg!(target_os = "linux") {
97+
return Ok(None);
9598
}
9699
}
97100

0 commit comments

Comments
 (0)