Skip to content

Commit

Permalink
Deleted layout tests from bindings.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cykooz committed Dec 2, 2024
1 parent 51aa2b9 commit 1203848
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 304 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
Now you can link the crate with any version of `libheif`
that is backward compatible with the version supported by the crate.

### Fixes

- Deleted layout tests from `bindings.rs`
([#8](https://github.com/Cykooz/libheif-sys/issues/8)).

## [3.0.1] - 2024-11-12

### Added
Expand Down
15 changes: 12 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ fn install_libheif_by_vcpkg() {
#[cfg(feature = "use-bindgen")]
fn run_bindgen() {
let mut base_builder = bindgen::Builder::default()
.header("include/wrapper.h")
.generate_comments(true)
.formatter(bindgen::Formatter::Rustfmt)
.generate_cstr(true)
Expand All @@ -183,9 +184,9 @@ fn run_bindgen() {
}

// The main module
let builder = base_builder.clone().header("include/wrapper.h");
// Finish the builder and generate the bindings.
let bindings = builder
let bindings = base_builder
.clone()
.generate()
// Unwrap the Result and panic on failure.
.expect("Unable to generate bindings");
Expand All @@ -194,7 +195,7 @@ fn run_bindgen() {
let out_path = PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
.expect("Couldn't write bindings.rs!");

// Create linker_test.ts module for testing cases when not all
// functions from *.h files are really available in libheif.
Expand Down Expand Up @@ -234,4 +235,12 @@ fn run_bindgen() {
let test_module = result.join("");
let test_path = out_path.join("linker_test.rs");
std::fs::write(&test_path, test_module).expect("Couldn't write test module!");

let bindings = base_builder
.layout_tests(false)
.generate()
.expect("Unable to generate bindings without tests");
bindings
.write_to_file(out_path.join("bindings_wo_tests.rs"))
.expect("Couldn't write bindings_wo_tests.rs!");
}
Loading

0 comments on commit 1203848

Please sign in to comment.