rs_bindings_from_cc: Add a reproducer that `a_rust_library.empty_source_no_public_headers.h` cannot be found.
We're able to handle to case correctly f the library that doesn't have a public header is a cc_library; however, if it's a rust_library, we'd run into an error.
PiperOrigin-RevId: 582283377
Change-Id: Ibe71134796d44a41b1ae6cac7cba04b95ed4b251
diff --git a/rs_bindings_from_cc/test/empty_public_header/BUILD b/rs_bindings_from_cc/test/empty_public_header/BUILD
new file mode 100644
index 0000000..567d516
--- /dev/null
+++ b/rs_bindings_from_cc/test/empty_public_header/BUILD
@@ -0,0 +1,37 @@
+load("@rules_rust//rust:defs.bzl", "rust_library")
+load("//common:crubit_wrapper_macros_oss.bzl", "crubit_rust_test")
+load("//rs_bindings_from_cc/test:test_bindings.bzl", "crubit_test_cc_library")
+
+package(default_applicable_licenses = ["//:license"])
+
+rust_library(
+ name = "rust_library",
+ srcs = [
+ "rust.rs",
+ ],
+)
+
+crubit_test_cc_library(
+ name = "cc_library_with_rust_deps",
+ srcs = [
+ "empty.cc",
+ ],
+ deps = [
+ ":rust_library",
+ ],
+)
+
+crubit_rust_test(
+ name = "main",
+ srcs = ["test.rs"],
+ cc_deps = [
+ ":cc_library_with_rust_deps",
+ ],
+ tags = [
+ # Currently, the test fails:
+ # crubit/rs_bindings_from_cc/test/empty_public_header/rust_library.empty_source_no_public_headers.h file not found
+ "manual",
+ "nobuilder",
+ "notap",
+ ],
+)
diff --git a/rs_bindings_from_cc/test/empty_public_header/empty.cc b/rs_bindings_from_cc/test/empty_public_header/empty.cc
new file mode 100644
index 0000000..c61a940
--- /dev/null
+++ b/rs_bindings_from_cc/test/empty_public_header/empty.cc
@@ -0,0 +1,3 @@
+// Part of the Crubit project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
diff --git a/rs_bindings_from_cc/test/empty_public_header/rust.rs b/rs_bindings_from_cc/test/empty_public_header/rust.rs
new file mode 100644
index 0000000..c61a940
--- /dev/null
+++ b/rs_bindings_from_cc/test/empty_public_header/rust.rs
@@ -0,0 +1,3 @@
+// Part of the Crubit project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
diff --git a/rs_bindings_from_cc/test/empty_public_header/test.rs b/rs_bindings_from_cc/test/empty_public_header/test.rs
new file mode 100644
index 0000000..4cb2be6
--- /dev/null
+++ b/rs_bindings_from_cc/test/empty_public_header/test.rs
@@ -0,0 +1,9 @@
+// Part of the Crubit project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn test_build() {}
+}