load("//rust:defs.bzl", "rust_binary", "rust_test") | |
rust_binary( | |
name = "hello-world", | |
srcs = ["src/main.rs"], | |
edition = "2018", | |
) | |
filegroup( | |
name = "hello_world_main", | |
srcs = ["src/main.rs"], | |
) | |
rust_test( | |
name = "test", | |
srcs = ["tests/run.rs"], | |
data = [ | |
":hello-world", | |
":hello_world_main", | |
], | |
edition = "2018", | |
env = { | |
"FERRIS_SAYS": "Hello fellow Rustaceans!", | |
"HELLO_WORLD_BIN": "$(rootpath :hello-world)", | |
"HELLO_WORLD_SRC": "$(rootpath :hello_world_main)", | |
}, | |
) |