fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
8cb9247f
0.10.0
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 ( 9name = "tools_exec_build_rs" , 10srcs = [ "build.rs" ], 11build_script_env = { "TOOL" : "$(execpath :tool)" }, 12edition = "2018" , 13# Add a flag to test that they're exposed to the build script 14rustc_flags = [ "--verbose" ], 15tools = [ ":tool" ], 16) 17 18write_file ( 19name = "tool" , 20out = "tool-file" , 21content = [ "" ], 22) 23 24rust_test ( 25name = "tools_exec" , 26srcs = [ "tools_exec.rs" ], 27edition = "2018" , 28deps = [ ":tools_exec_build_rs" ], 29)