Update build files of test suite
diff --git a/tests/BUCK b/tests/BUCK
index 659223c..41781c8 100644
--- a/tests/BUCK
+++ b/tests/BUCK
@@ -6,7 +6,10 @@
rust_library(
name = "ffi",
- srcs = ["ffi/lib.rs"],
+ srcs = [
+ "ffi/lib.rs",
+ "ffi/module.rs",
+ ],
crate = "cxx_test_suite",
deps = [
":impl",
@@ -18,25 +21,33 @@
name = "impl",
srcs = [
"ffi/tests.cc",
- ":gen-source",
+ ":gen-lib-source",
+ ":gen-module-source",
],
headers = {
- "ffi/lib.rs.h": ":gen-header",
+ "ffi/lib.rs.h": ":gen-lib-header",
"ffi/tests.h": "ffi/tests.h",
},
deps = ["//:core"],
)
genrule(
- name = "gen-header",
+ name = "gen-lib-header",
srcs = ["ffi/lib.rs"],
cmd = "$(exe //:codegen) --header ${SRCS} > ${OUT}",
- out = "generated.h",
+ out = "lib.rs.h",
)
genrule(
- name = "gen-source",
+ name = "gen-lib-source",
srcs = ["ffi/lib.rs"],
cmd = "$(exe //:codegen) ${SRCS} > ${OUT}",
- out = "generated.cc",
+ out = "lib.rs.cc",
+)
+
+genrule(
+ name = "gen-module-source",
+ srcs = ["ffi/module.rs"],
+ cmd = "$(exe //:codegen) ${SRCS} > ${OUT}",
+ out = "module.rs.cc",
)
diff --git a/tests/BUILD b/tests/BUILD
index 65c5b41..e1f1637 100644
--- a/tests/BUILD
+++ b/tests/BUILD
@@ -8,7 +8,10 @@
rust_library(
name = "cxx_test_suite",
- srcs = ["ffi/lib.rs"],
+ srcs = [
+ "ffi/lib.rs",
+ "ffi/module.rs",
+ ],
deps = [
":impl",
"//:cxx",
@@ -19,17 +22,18 @@
name = "impl",
srcs = [
"ffi/tests.cc",
- ":gen-source",
+ ":gen-lib-source",
+ ":gen-module-source",
],
hdrs = ["ffi/tests.h"],
deps = [
- ":include",
+ ":lib-include",
"//:core",
],
)
genrule(
- name = "gen-header",
+ name = "gen-lib-header",
srcs = ["ffi/lib.rs"],
outs = ["lib.rs.h"],
cmd = "$(location //:codegen) --header $< > $@",
@@ -37,15 +41,23 @@
)
genrule(
- name = "gen-source",
+ name = "gen-lib-source",
srcs = ["ffi/lib.rs"],
- outs = ["generated.cc"],
+ outs = ["lib.rs.cc"],
cmd = "$(location //:codegen) $< > $@",
tools = ["//:codegen"],
)
cc_library(
- name = "include",
- hdrs = [":gen-header"],
+ name = "lib-include",
+ hdrs = [":gen-lib-header"],
include_prefix = "tests/ffi",
)
+
+genrule(
+ name = "gen-module-source",
+ srcs = ["ffi/module.rs"],
+ outs = ["module.rs.cc"],
+ cmd = "$(location //:codegen) $< > $@",
+ tools = ["//:codegen"],
+)
diff --git a/third-party/Cargo.lock b/third-party/Cargo.lock
index 231863d..b1227f9 100644
--- a/third-party/Cargo.lock
+++ b/third-party/Cargo.lock
@@ -356,9 +356,9 @@
[[package]]
name = "trybuild"
-version = "1.0.26"
+version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e5696e4fd793743fbcc29943fe965ea3993b6c3d2a6a3a35c6680d926fd3a49"
+checksum = "744665442556a91933cee5e75b0371376eb03498c4d0bfbcebd2a9882b4fb5ef"
dependencies = [
"dissimilar",
"glob",