Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bindgen-tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@ fn test_mixed_header_and_header_contents() {
}
}

#[test]
#[should_panic(expected = "No headers provided")]
fn test_no_header_provided() {
let _ = builder().generate();
}

#[test]
fn test_macro_fallback_non_system_dir() {
let actual = builder()
Expand Down
5 changes: 5 additions & 0 deletions bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ impl Builder {
.map(String::into_boxed_str),
);

assert!(
!self.options.input_headers.is_empty() ||
!self.options.input_header_contents.is_empty(),
"No headers provided"
);
for header in &self.options.input_headers {
self.options
.for_each_callback(|cb| cb.header_file(header.as_ref()));
Expand Down