fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

David TolnayOutside of examples, fill in all `edition` attrs (#1257)03a70796

0.6.0
700 B29 linesraw
1"""Tests for the cargo_build_script rule"""
2
3load("//cargo:cargo_build_script.bzl", "cargo_build_script")
4load("//rust:defs.bzl", "rust_test")
5
6# Test that tools are built in the exec configuration.
7cargo_build_script(
8    name = "tools_exec_build_rs",
9    srcs = ["build.rs"],
10    build_script_env = {"TOOL": "$(execpath :tool)"},
11    edition = "2018",
12    # Add a flag to test that they're exposed to the build script
13    rustc_flags = ["--verbose"],
14    tools = [":tool"],
15)
16
17genrule(
18    name = "tool",
19    srcs = [],
20    outs = ["tool-file"],
21    cmd = "touch $@",
22)
23
24rust_test(
25    name = "tools_exec",
26    srcs = ["tools_exec.rs"],
27    edition = "2018",
28    deps = [":tools_exec_build_rs"],
29)