xref: /aosp_15_r20/external/bazelbuild-rules_rust/test/toolchain/BUILD.bazel (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifanload("@bazel_skylib//rules:build_test.bzl", "build_test")
2*d4726bddSHONG Yifanload(":toolchain_test.bzl", "toolchain_test_suite")
3*d4726bddSHONG Yifan
4*d4726bddSHONG Yifantoolchain_test_suite(name = "toolchain_test_suite")
5*d4726bddSHONG Yifan
6*d4726bddSHONG Yifangenrule(
7*d4726bddSHONG Yifan    name = "inspect",
8*d4726bddSHONG Yifan    outs = ["rustc-cfg"],
9*d4726bddSHONG Yifan    # rustc assumes it can read things like librustc_driver in order to run this command.
10*d4726bddSHONG Yifan    # This is a test to ensure we supply all of the files rustc needs as part of the current_rust_toolchain.
11*d4726bddSHONG Yifan    cmd = "$(RUSTC) --print=cfg > $@",
12*d4726bddSHONG Yifan    toolchains = ["@rules_rust//rust/toolchain:current_rust_toolchain"],
13*d4726bddSHONG Yifan    tools = ["@rules_rust//rust/toolchain:current_rust_toolchain"],
14*d4726bddSHONG Yifan)
15*d4726bddSHONG Yifan
16*d4726bddSHONG Yifanbuild_test(
17*d4726bddSHONG Yifan    name = "inspect_build_test",
18*d4726bddSHONG Yifan    targets = [":inspect"],
19*d4726bddSHONG Yifan)
20