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