fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
5ef52e46
main
1load ( ":current_toolchain_files_test.bzl" , "current_toolchain_files_test" ) 2 3exports_files ([ 4"current_toolchain_files_test.sh" , 5]) 6 7# Executable targets will output a pattern similar to the following 8# cargo 1.53.0 (4369396ce 2021-04-27) 9# Also Note, rustc_srcs is too big for this test 10_FILES = { 11"cargo" : ( "executable" , r"^cargo [0-9\.]\+\(-nightly\)\? ([0-9a-z]\+ [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\})" ), 12"clippy" : ( "executable" , r"^clippy [0-9\.]\+ ([0-9a-z]\+ [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\})" ), 13"rust_stdlib" : ( "files" , r"\.rlib" ), 14"rustc" : ( "executable" , r"^rustc [0-9\.]\+\(-nightly\)\? ([0-9a-z]\+ [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\})" ), 15"rustc_lib" : ( "files" , r"rustc_driver" ), 16"rustdoc" : ( "executable" , r"^rustdoc [0-9\.]\+\(\-nightly\)\? ([0-9a-z]\+ [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\})" ), 17"rustfmt" : ( "executable" , r"^rustfmt [0-9\.]\+\-\(stable\|nightly\) ([0-9a-z]\+ [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\})" ), 18} 19 20# Test that all toolchain tools consumable (executables are executable and filegroups contain expected sources) 21[ 22current_toolchain_files_test ( 23name = tool + "_test" , 24kind = kind , 25pattern = pattern , 26# TOOO: Windows requires use of bash which is not guaranteed to be available. 27# The test runner should ideally be rewritten in rust so that windows could 28# be tested. 29target_compatible_with = select ({ 30"@platforms//os:windows" : [ "@platforms//:incompatible" ], 31"//conditions:default" : [], 32}), 33tool = "//rust/toolchain:current_{}_files" . format ( tool ), 34) 35for tool , ( kind , pattern ) in _FILES . items () 36]