Skip to content

Commit 3bd14b4

Browse files
committed
test: replace workspace_dir arg with binary_dir in get_binary
Instead of get_binary assuming it always operates on a cargo build directory, have it directly operate on a "binary directory" in the sense of the --binary-dir parameter. Nothing was using the workspace_dir arg, so no functional changes. Signed-off-by: Patrick Roy <[email protected]>
1 parent f25ab54 commit 3bd14b4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/host_tools/cargo_build.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pathlib import Path
88

99
from framework import defs, utils
10-
from framework.defs import FC_WORKSPACE_DIR
10+
from framework.defs import DEFAULT_BINARY_DIR
1111
from framework.with_filelock import with_filelock
1212

1313
DEFAULT_TARGET = f"{platform.machine()}-unknown-linux-musl"
@@ -56,12 +56,11 @@ def cargo_test(path, extra_args=""):
5656
cargo("test", extra_args + " --all --no-fail-fast", env=env)
5757

5858

59-
def get_binary(name, *, workspace_dir=FC_WORKSPACE_DIR, example=None):
59+
def get_binary(name, *, binary_dir=DEFAULT_BINARY_DIR, example=None):
6060
"""Get a binary. The binaries are built before starting a testrun."""
61-
target_dir = workspace_dir / "build" / "cargo_target" / DEFAULT_TARGET_DIR
62-
bin_path = target_dir / name
61+
bin_path = binary_dir / name
6362
if example:
64-
bin_path = target_dir / "examples" / example
63+
bin_path = binary_dir / "examples" / example
6564
return bin_path
6665

6766

0 commit comments

Comments
 (0)