• Home
  • Raw
  • Download

Lines Matching +full:concat +full:- +full:map

12 #[path = "../../bindgen-cli/options.rs"]
19 fn format_code<S: AsRef<str>>(source: S) -> syn::Result<String> { in format_code()
27 fn should_overwrite_expected() -> bool { in should_overwrite_expected()
44 ) -> Result<(), Error> { in error_diff_mismatch()
46 println!("--- expected: {:?}", filename); in error_diff_mismatch()
60 //usecase: var = "meld" -> You can hand check differences in error_diff_mismatch()
80 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { in fmt()
98 ChangeTag::Delete => ("-", Style::new().red()), in show_diff()
127 ) -> Result<(), Error> { in compare_generated_header()
146 expectation.push("libclang-16"); in compare_generated_header()
148 expectation.push("libclang-9"); in compare_generated_header()
151 None => expectation.push("libclang-16"), in compare_generated_header()
161 expectation.push(format!("libclang-{}", version_str)); in compare_generated_header()
232 fn builder() -> Builder { in builder()
248 ) -> Result<(Builder, Option<BuilderState>), Error> { in into_builder()
268 fn create_bindgen_builder(header: &Path) -> Result<BuilderState, Error> { in create_bindgen_builder()
275 // Scoop up bindgen-flags from test header in create_bindgen_builder()
285 if line.contains("bindgen-flags: ") { in create_bindgen_builder()
287 .split("bindgen-flags: ") in create_bindgen_builder()
292 } else if line.contains("bindgen-osx-only") { in create_bindgen_builder()
293 let prepend_flags = ["--raw-line", "#![cfg(target_os=\"macos\")]"]; in create_bindgen_builder()
296 .map(ToString::to_string) in create_bindgen_builder()
299 } else if line.contains("bindgen-parse-callbacks: ") { in create_bindgen_builder()
301 line.split("bindgen-parse-callbacks: ").last().unwrap(); in create_bindgen_builder()
307 // We make the default target as x86_64-unknown-linux in create_bindgen_builder()
308 if flags.iter().all(|flag| !flag.starts_with("--target=")) { in create_bindgen_builder()
309 if !flags.iter().any(|flag| flag == "--") { in create_bindgen_builder()
310 flags.push("--".into()); in create_bindgen_builder()
312 flags.push("--target=x86_64-unknown-linux".into()); in create_bindgen_builder()
316 // - add "bindgen" as executable name 0th element in create_bindgen_builder()
317 // - add header filename as 1st element in create_bindgen_builder()
318 // - prepend raw lines so they're in the right order for expected output in create_bindgen_builder()
319 // - append the test header's bindgen flags in create_bindgen_builder()
328 "--formatter=none", in create_bindgen_builder()
329 "--with-derive-default", in create_bindgen_builder()
330 "--disable-header-comment", in create_bindgen_builder()
331 "--vtable-generation", in create_bindgen_builder()
333 "--raw-line", in create_bindgen_builder()
335 "--raw-line", in create_bindgen_builder()
337 "--raw-line", in create_bindgen_builder()
341 let args = prepend.iter().map(ToString::to_string).chain(flags); in create_bindgen_builder()
372 include!(concat!(env!("OUT_DIR"), "/tests.rs"));
379 "-D_ENV_ONE=1 -D_ENV_TWO=\"2 -DNOT_THREE=1\"", in test_clang_env_args()
414 .clang_arg("--target=x86_64-unknown-linux") in test_header_contents()
423 pub fn foo(a: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; in test_header_contents()
435 .header(concat!( in test_multiple_header_calls_in_builder()
439 .header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/headers/char.h")) in test_multiple_header_calls_in_builder()
440 .clang_arg("--target=x86_64-unknown-linux") in test_multiple_header_calls_in_builder()
447 let expected_filename = concat!( in test_multiple_header_calls_in_builder()
451 let expected = include_str!(concat!( in test_multiple_header_calls_in_builder()
473 concat!(env!("CARGO_MANIFEST_DIR"), "/tests/headers/func_ptr.h"), in test_headers_call_in_builder()
474 concat!(env!("CARGO_MANIFEST_DIR"), "/tests/headers/char.h"), in test_headers_call_in_builder()
476 .clang_arg("--target=x86_64-unknown-linux") in test_headers_call_in_builder()
483 let expected_filename = concat!( in test_headers_call_in_builder()
487 let expected = include_str!(concat!( in test_headers_call_in_builder()
510 .clang_arg("--target=x86_64-unknown-linux") in test_multiple_header_contents()
519 pub fn foo2(b: *const ::std::os::raw::c_char) -> f32; in test_multiple_header_contents()
522 pub fn foo(a: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; in test_multiple_header_contents()
534 .header(concat!( in test_mixed_header_and_header_contents()
538 .header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/headers/char.h")) in test_mixed_header_and_header_contents()
541 .clang_arg("--target=x86_64-unknown-linux") in test_mixed_header_and_header_contents()
548 let expected_filename = concat!( in test_mixed_header_and_header_contents()
552 let expected = include_str!(concat!( in test_mixed_header_and_header_contents()
571 .header(concat!( in test_macro_fallback_non_system_dir()
575 .header(concat!( in test_macro_fallback_non_system_dir()
580 .clang_arg(format!("-I{}/tests/headers", env!("CARGO_MANIFEST_DIR"))) in test_macro_fallback_non_system_dir()
589 let expected_filename = concat!( in test_macro_fallback_non_system_dir()
591 "/tests/expectations/tests/libclang-9/macro_fallback_non_system_dir.rs", in test_macro_fallback_non_system_dir()
593 let expected = include_str!(concat!( in test_macro_fallback_non_system_dir()
595 "/tests/expectations/tests/libclang-9/macro_fallback_non_system_dir.rs", in test_macro_fallback_non_system_dir()
600 let expected_filename = concat!( in test_macro_fallback_non_system_dir()
604 let expected = include_str!(concat!( in test_macro_fallback_non_system_dir()
629 assert!(Command::new("../ci/no-includes.sh") in no_system_header_includes()
632 .expect("should spawn ../ci/no-includes.sh OK") in no_system_header_includes()
634 .expect("should wait for ../ci/no-includes OK") in no_system_header_includes()
640 let header = PathBuf::from("tests/headers/enum-default-rust.h"); in emit_depfile()
645 .join("enum-default-rust.d"); in emit_depfile()
649 "tests/expectations/tests/enum-default-rust.rs", in emit_depfile()
667 concat!(env!("CARGO_MANIFEST_DIR"), "/tests/headers/arg_keyword.hpp"); in dump_preprocessed_input()
668 let empty_layout = concat!( in dump_preprocessed_input()
670 "/tests/headers/cpp-empty-layout.hpp" in dump_preprocessed_input()
679 fn slurp(p: &str) -> String { in dump_preprocessed_input()
696 "cpp-empty-layout.hpp is in the preprocessed file" in dump_preprocessed_input()
706 .map(|x| format!("{}", shlex::try_quote(x).unwrap())) in build_flags_output_helper()
722 .header("tests/headers/16-byte-alignment.h"); in commandline_multiple_headers()
740 .header("tests/headers/wrap-static-fns.h") in test_wrap_static_fns()