test result: FAILED. 97 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out

of all the remaining failures, 6 of them are due to 'error: the option
`Z` is only accepted on the nightly compiler', the only real error
standing out is test_enum from a macro definition conflict ?

error: expected parameter declarator
static_assert(offsetof(CBINDGEN_STRUCT(P), tag) == 0,"unexpected offset for tag");
/usr/include/stddef.h:69:32: note: expanded from macro 'offsetof'
#define offsetof(type, member)  __builtin_offsetof(type, member)
This commit is contained in:
landry 2020-08-04 10:47:44 +00:00
parent 007ea611e7
commit 919659825c

View File

@ -1,13 +1,15 @@
$OpenBSD: patch-tests_tests_rs,v 1.2 2019/07/10 07:56:08 landry Exp $
$OpenBSD: patch-tests_tests_rs,v 1.3 2020/08/04 10:47:44 landry Exp $
supposed to read CXX & CC from env, but for some reason this doesnt work ?
all the other chunks from https://github.com/eqrion/cbindgen/commit/398b631e1d3f90ccab7ef79eca72e49c147dd9d2
Index: tests/tests.rs
--- tests/tests.rs.orig
+++ tests/tests.rs
@@ -61,8 +61,8 @@ fn run_cbindgen(
fn compile(cbindgen_output: &Path, language: Language) {
@@ -71,8 +71,8 @@ fn compile(
skip_warning_as_error: bool,
) {
let cc = match language {
- Language::Cxx => env::var("CXX").unwrap_or_else(|_| "g++".to_owned()),
- Language::C => env::var("CC").unwrap_or_else(|_| "gcc".to_owned()),
@ -15,4 +17,41 @@ Index: tests/tests.rs
+ Language::C => env::var("CC").unwrap_or_else(|_| "cc".to_owned()),
};
let mut object = cbindgen_output.to_path_buf();
let file_name = cbindgen_output
@@ -83,8 +83,6 @@ fn compile(
let mut command = Command::new(cc);
command.arg("-D").arg("DEFINED");
- command.arg("-c").arg(cbindgen_output);
- command.arg("-o").arg(&object);
command.arg("-I").arg(tests_path);
command.arg("-Wall");
if !skip_warning_as_error {
@@ -92,10 +90,17 @@ fn compile(
}
// `swift_name` is not recognzied by gcc.
command.arg("-Wno-attributes");
+ // clang warns about unused const variables.
+ command.arg("-Wno-unused-const-variable");
+ // clang also warns about returning non-instantiated templates (they could
+ // be specialized, but they're not so it's fine).
+ command.arg("-Wno-return-type-c-linkage");
if let Language::Cxx = language {
// enum class is a c++11 extension which makes g++ on macos 10.14 error out
// inline variables are are a c++17 extension
command.arg("-std=c++17");
+ // Prevents warnings when compiling .c files as c++.
+ command.arg("-x").arg("c++");
if let Ok(extra_flags) = env::var("CXXFLAGS") {
command.args(extra_flags.split_whitespace());
}
@@ -112,6 +117,9 @@ fn compile(
style_str(style).to_uppercase()
));
}
+
+ command.arg("-c").arg(cbindgen_output);
+ command.arg("-o").arg(&object);
println!("Running: {:?}", command);
let out = command.output().expect("failed to compile");