fork/rules_rust

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

UebelAndreReplaced small genrules with uses of bazel_skylib (#1451)8cb9247f

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