fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
69ddb09d
main
1load ( "@bazel_skylib//rules:build_test.bzl" , "build_test" ) 2load ( "@bazel_skylib//rules:diff_test.bzl" , "diff_test" ) 3load ( "@rules_cc//cc:defs.bzl" , "cc_binary" ) 4load ( "//rust:defs.bzl" , "rust_binary" , "rust_test" ) 5load ( "//test/process_wrapper:process_wrapper_tester.bzl" , "process_wrapper_tester" ) 6 7cc_binary ( 8name = "process_wrapper_tester" , 9srcs = [ 10"process_wrapper_tester.cc" , 11], 12visibility = [ "//visibility:public" ], 13) 14 15filegroup ( 16name = "env_files" , 17srcs = [ 18"test_files/env_file1" , 19"test_files/env_file2" , 20"test_files/env_file3" , 21], 22) 23 24filegroup ( 25name = "arg_files" , 26srcs = [ 27"test_files/arg_file1" , 28"test_files/arg_file2" , 29"test_files/arg_file3" , 30], 31) 32 33filegroup ( 34name = "stdout_file" , 35srcs = [ 36"test_files/stdout" , 37], 38) 39 40filegroup ( 41name = "stderr_file" , 42srcs = [ 43"test_files/stderr" , 44], 45) 46 47process_wrapper_tester ( 48name = "process_wrapper_basic" , 49test_config = "basic" , 50) 51 52process_wrapper_tester ( 53name = "process_wrapper_subst_pwd" , 54test_config = "subst-pwd" , 55) 56 57process_wrapper_tester ( 58name = "process_wrapper_stdout" , 59test_config = "stdout" , 60) 61 62process_wrapper_tester ( 63name = "process_wrapper_stderr" , 64test_config = "stderr" , 65) 66 67process_wrapper_tester ( 68name = "process_wrapper_env_files" , 69env_files = [ 70":env_files" , 71], 72test_config = "env-files" , 73) 74 75process_wrapper_tester ( 76name = "process_wrapper_arg_files" , 77arg_files = [ 78":arg_files" , 79], 80test_config = "arg-files" , 81) 82 83process_wrapper_tester ( 84name = "process_wrapper_copy_output" , 85test_config = "copy-output" , 86) 87 88process_wrapper_tester ( 89name = "process_wrapper_combined" , 90arg_files = [ 91":arg_files" , 92], 93env_files = [ 94":env_files" , 95], 96test_config = "combined" , 97) 98 99build_test ( 100name = "basic_test" , 101targets = [ 102":process_wrapper_basic" , 103], 104) 105 106build_test ( 107name = "subst_pwd_test" , 108targets = [ 109":process_wrapper_subst_pwd" , 110], 111) 112 113diff_test ( 114name = "stdout_test" , 115file1 = ":stdout_file" , 116file2 = ":process_wrapper_stdout" , 117) 118 119diff_test ( 120name = "stderr_test" , 121file1 = ":stderr_file" , 122file2 = ":process_wrapper_stderr" , 123) 124 125build_test ( 126name = "env_files_test" , 127targets = [ 128":process_wrapper_env_files" , 129], 130) 131 132build_test ( 133name = "arg_files_test" , 134targets = [ 135":process_wrapper_arg_files" , 136], 137) 138 139build_test ( 140name = "copy_output_test" , 141targets = [ 142":process_wrapper_copy_output" , 143], 144) 145 146build_test ( 147name = "combined_test" , 148targets = [ 149":process_wrapper_combined" , 150], 151) 152 153rust_binary ( 154name = "fake_rustc" , 155srcs = [ "fake_rustc.rs" ], 156edition = "2018" , 157) 158 159rust_test ( 160name = "rustc_quit_on_rmeta" , 161srcs = [ "rustc_quit_on_rmeta.rs" ], 162data = [ 163":fake_rustc" , 164"//util/process_wrapper" , 165], 166edition = "2018" , 167rustc_env = { 168"FAKE_RUSTC_RLOCATIONPATH" : "$(rlocationpath :fake_rustc)" , 169"PROCESS_WRAPPER_RLOCATIONPATH" : "$(rlocationpath //util/process_wrapper)" , 170}, 171deps = [ "//tools/runfiles" ], 172)