Skip to content

Commit 0c7c5d3

Browse files
committed
Update
[ghstack-poisoned]
1 parent 7abfa44 commit 0c7c5d3

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

.ci/scripts/wheel/test_windows.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,43 @@
55
# This source code is licensed under the BSD-style license found in the
66
# LICENSE file in the root directory of this source tree.
77

8+
import os
9+
import subprocess
810
import test_base
911
from examples.models import Backend, Model
12+
from test_base import ModelTest
13+
from typing import List
14+
15+
def map_backend_name(name: str) -> str:
16+
# Map the backend name to the string used by the Windows test jobs, which use
17+
# a slightly different convention. This is an artifact of us being mid-update
18+
# of the model test logic.
19+
# TODO(gjcomer) Clean this up when we update the model test CI.
20+
21+
if name == "xnnpack-quantization-delegation":
22+
return "xnnpack-q8"
23+
else:
24+
return name
25+
26+
def run_tests(model_tests: List[ModelTest]) -> None:
27+
for model_test in model_tests:
28+
subprocess.run(
29+
[
30+
os.path.join(test_base._repository_root_dir(), ".ci/scripts/test_model.ps1"),
31+
"-ModelName",
32+
str(model_test.model),
33+
"-Backend",
34+
map_backend_name(str(model_test.backend)),
35+
],
36+
check=True,
37+
cwd=test_base._repository_root_dir(),
38+
)
39+
1040

1141
if __name__ == "__main__":
1242
test_base.run_tests(
1343
model_tests=[
14-
test_base.ModelTest(
44+
ModelTest(
1545
model=Model.Mv3,
1646
backend=Backend.XnnpackQuantizationDelegation,
1747
),

0 commit comments

Comments
 (0)