aports/main/rust-bindgen/disable-test_wrap_static_fns-patch
2024-12-07 01:20:30 +00:00

44 lines
1.6 KiB
Text

--- a/bindgen-tests/tests/tests.rs
+++ b/bindgen-tests/tests/tests.rs
@@ -718,41 +718,3 @@ fn commandline_multiple_headers() {
.header("tests/headers/16-byte-alignment.h");
build_flags_output_helper(&bindings);
}
-
-#[test]
-fn test_wrap_static_fns() {
- // This test is for testing diffs of the generated C source and header files
- // TODO: If another such feature is added, convert this test into a more generic
- // test that looks at `tests/headers/generated` directory.
- let expect_path = PathBuf::from("tests/expectations/tests/generated")
- .join("wrap_static_fns");
- println!("In path is ::: {}", expect_path.display());
-
- let generated_path =
- PathBuf::from(env::var("OUT_DIR").unwrap()).join("wrap_static_fns");
- println!("Out path is ::: {}", generated_path.display());
-
- let _bindings = Builder::default()
- .header("tests/headers/wrap-static-fns.h")
- .wrap_static_fns(true)
- .wrap_static_fns_path(generated_path.display().to_string())
- .parse_callbacks(Box::new(parse_callbacks::WrapAsVariadicFn))
- .generate()
- .expect("Failed to generate bindings");
-
- let expected_c = fs::read_to_string(expect_path.with_extension("c"))
- .expect("Could not read generated wrap_static_fns.c");
-
- let actual_c = fs::read_to_string(generated_path.with_extension("c"))
- .expect("Could not read actual wrap_static_fns.c");
-
- if expected_c != actual_c {
- error_diff_mismatch(
- &actual_c,
- &expected_c,
- None,
- &expect_path.with_extension("c"),
- )
- .unwrap();
- }
-}