Skip to content

Commit 5b1004c

Browse files
authored
Arm backend: Enable collating TOSA files from all tests (#15487)
Make all backend test flows from use the TOSA_TESTCASES_BASE_PATH env variable to collect temporary output Signed-off-by: Zingo Andersen <[email protected]>
1 parent b7b6117 commit 5b1004c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

backends/arm/test/common.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def maybe_get_tosa_collate_path() -> str | None:
6666

6767
def get_tosa_compile_spec(
6868
tosa_spec: str | TosaSpecification,
69-
custom_path=None,
69+
custom_path: Optional[str] = None,
7070
tosa_debug_mode: TosaCompileSpec.DebugMode | None = None,
7171
) -> TosaCompileSpec:
7272
"""Get the compile spec for default TOSA tests."""
@@ -93,6 +93,8 @@ def get_u55_compile_spec(
9393
tosa_debug_mode: EthosUCompileSpec.DebugMode | None = None,
9494
) -> EthosUCompileSpec:
9595
"""Default compile spec for Ethos-U55 tests."""
96+
if not custom_path:
97+
custom_path = maybe_get_tosa_collate_path()
9698
artifact_path = custom_path or tempfile.mkdtemp(prefix="arm_u55_")
9799
if not os.path.exists(artifact_path):
98100
os.makedirs(artifact_path, exist_ok=True)
@@ -129,6 +131,8 @@ def get_u85_compile_spec(
129131
) -> EthosUCompileSpec:
130132
"""Default compile spec for Ethos-U85 tests."""
131133

134+
if not custom_path:
135+
custom_path = maybe_get_tosa_collate_path()
132136
artifact_path = custom_path or tempfile.mkdtemp(prefix="arm_u85_")
133137
if not os.path.exists(artifact_path):
134138
os.makedirs(artifact_path, exist_ok=True)
@@ -157,12 +161,15 @@ def get_u85_compile_spec(
157161
def get_vgf_compile_spec(
158162
tosa_spec: str | TosaSpecification,
159163
compiler_flags: Optional[str] = "",
160-
custom_path=None,
164+
custom_path: Optional[str] = None,
161165
tosa_debug_mode: VgfCompileSpec.DebugMode | None = None,
162166
) -> VgfCompileSpec:
163167
"""Get the ArmCompileSpec for the default VGF tests, to modify
164168
the compile spec before calling .build() to finalize it.
165169
"""
170+
171+
if not custom_path:
172+
custom_path = maybe_get_tosa_collate_path()
166173
if "FP" in repr(tosa_spec):
167174
artifact_path = custom_path or tempfile.mkdtemp(prefix="arm_vgf_fp_")
168175
elif "INT" in repr(tosa_spec):

0 commit comments

Comments
 (0)