From a2c41e5e5e452ab2d8ee69e3db84cfe94031bab0 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Wed, 24 May 2017 16:28:52 -0700 Subject: 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. --- tests/headers/call-conv-field.h | 6 ++++++ tests/tests.rs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/tests/headers/call-conv-field.h b/tests/headers/call-conv-field.h index 310b5c32..3488cd5b 100644 --- a/tests/headers/call-conv-field.h +++ b/tests/headers/call-conv-field.h @@ -1,5 +1,11 @@ // bindgen-flags: -- -target i686-pc-win32 // bindgen-unstable +// bindgen-generate-bindings-on-linux-only +// +// The linux-only thing is a hack around our lack of understanding when +// bindgen's target_os != the bindings' target_os :( +// +// https://github.com/servo/rust-bindgen/issues/593 struct JNINativeInterface_ { int (__stdcall *GetVersion)(void *env); diff --git a/tests/tests.rs b/tests/tests.rs index c7e03cb5..85fcc197 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -92,6 +92,9 @@ fn create_bindgen_builder(header: &PathBuf) -> Result, Error> { .map(ToString::to_string) .chain(flags) .collect(); + } else if line.contains("bindgen-generate-bindings-on-linux-only") && + !cfg!(target_os = "linux") { + return Ok(None); } } -- cgit v1.2.3