Skip to content

Commit 77fcc4d

Browse files
authored
[workerd-cxx] Add test_expand build target to expand proc_macros
Just adds a test_expand build target which expands the //kj-rs/tests:awaitables-rust_test target macros, as well as a justfile target for doing so
1 parent 69bdfef commit 77fcc4d

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_exten
1616
use_repo(cc_configure, "local_config_cc")
1717

1818
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
19-
rust.toolchain(versions = ["1.86.0"])
19+
rust.toolchain(versions = ["1.86.0", "nightly/2025-06-06"])
2020
use_repo(rust, "rust_toolchains")
2121

2222
register_toolchains("@rust_toolchains//:all")

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ test:
1414
clippy:
1515
bazel build --config=clippy //...
1616

17+
expand:
18+
bazel build //kj-rs/tests:expand-rust_test
19+
1720
cargo-update:
1821
bazel run //third-party:vendor
1922

kj-rs/tests/BUILD.bazel

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_cc//cc:defs.bzl", "cc_library")
2-
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
2+
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test", "rust_unpretty")
33
load("//tools/bazel:rust_cxx_bridge.bzl", "rust_cxx_bridge")
44

55
# https://bazel.build/configure/windows#clang
@@ -24,6 +24,14 @@ rust_library(
2424
],
2525
)
2626

27+
rust_unpretty(
28+
name = "expand-rust_test",
29+
testonly = True,
30+
deps = [
31+
":awaitables-rust_test"
32+
]
33+
)
34+
2735
rust_test(
2836
name = "awaitables-rust_test",
2937
crate = "awaitables-rust",

0 commit comments

Comments
 (0)