1load("//rust:defs.bzl", "rust_binary", "rust_test") 2 3rust_binary( 4 name = "hello-world", 5 srcs = ["src/main.rs"], 6 edition = "2018", 7) 8 9filegroup( 10 name = "hello_world_main", 11 srcs = ["src/main.rs"], 12) 13 14rust_test( 15 name = "test", 16 srcs = ["tests/run.rs"], 17 data = [ 18 ":hello-world", 19 ":hello_world_main", 20 ], 21 edition = "2018", 22 env = { 23 "FERRIS_SAYS": "Hello fellow Rustaceans!", 24 "HELLO_WORLD_BIN": "$(rootpath :hello-world)", 25 "HELLO_WORLD_SRC": "$(rootpath :hello_world_main)", 26 }, 27) 28