diff options
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/main.rs | 21 |
2 files changed, 5 insertions, 17 deletions
@@ -501,7 +501,6 @@ impl Builder { if self.input_headers.len() > 1 { // To pass more than one header, we need to pass all but the last // header via the `-include` clang arg - output_vector.reserve(2 * self.input_headers.len() - 2); for header in &self.input_headers[..self.input_headers.len() - 1] { output_vector.push("-include".to_string()); output_vector.push(header.clone()); diff --git a/src/main.rs b/src/main.rs index 168d6cc0..5a9c3318 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,25 +102,14 @@ mod test { let flags_str = flags_quoted.join(" "); println!("{}", flags_str); - crate::options::builder_from_flags(command_line_flags.into_iter()) - .unwrap(); + let (builder, _output, _verbose) = + crate::options::builder_from_flags(command_line_flags.into_iter()) + .unwrap(); + builder.generate().expect("failed to generate bindings"); } #[test] - fn commandline_flag_roundtrip() { - // test1: various options - let bindings = bindgen::Builder::default() - .header("tests/headers/char.h") - .record_matches(false) - .size_t_is_usize(true) - .rustfmt_bindings(false) - .rustfmt_configuration_file(Some(PathBuf::from("/dev/null"))) - .no_partialeq(".") - .no_copy(".") - .no_hash("."); - build_flags_output_helper(&bindings); - - // test2: multiple headers + fn commandline_multiple_headers() { let bindings = bindgen::Builder::default() .header("tests/headers/char.h") .header("tests/headers/func_ptr.h") |