Skip to content

Commit 4f584fb

Browse files
author
Tamas Vajk
committed
Fix remap tests to be platform-independent
Use prefix/suffix matching instead of hardcoding k8-fastbuild in the bin dir path, so tests pass on macOS (darwin_arm64-fastbuild) too.
1 parent 4722564 commit 4f584fb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/unit/remap_path_prefix/remap_path_prefix_test.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ load(
77
"//test/unit:common.bzl",
88
"assert_action_mnemonic",
99
"assert_argv_contains",
10+
"assert_argv_contains_prefix_suffix",
1011
"assert_list_contains_adjacent_elements",
1112
)
1213

@@ -34,8 +35,8 @@ def _remap_path_prefix_generated_test_impl(ctx):
3435
action = target.actions[0]
3536
assert_action_mnemonic(env, action, "Rustc")
3637

37-
assert_argv_contains(env, action, "--remap-path-prefix=${pwd}/bazel-out/k8-fastbuild/bin=.")
38-
assert_argv_contains(env, action, "--remap-path-prefix=${exec_root}/bazel-out/k8-fastbuild/bin=.")
38+
assert_argv_contains_prefix_suffix(env, action, "--remap-path-prefix=${pwd}/bazel-out/", "/bin=.")
39+
assert_argv_contains_prefix_suffix(env, action, "--remap-path-prefix=${exec_root}/bazel-out/", "/bin=.")
3940
assert_argv_contains(env, action, "--remap-path-prefix=${output_base}=.")
4041

4142
return analysistest.end(env)

0 commit comments

Comments
 (0)