Просмотр исходного кода

fix(test): default 6400 cocotb profiles

root 3 месяцев назад
Родитель
Сommit
122e59c3ac
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      tests/cocotb/run_6400_v1_integration.py

+ 8 - 4
tests/cocotb/run_6400_v1_integration.py

@@ -63,16 +63,20 @@ def main(argv: list[str] | None = None) -> int:
     parser.add_argument(
     parser.add_argument(
         "profiles",
         "profiles",
         nargs="*",
         nargs="*",
-        choices=("control", "identification", "host_protocol"),
-        default=("control", "identification", "host_protocol"),
+        metavar="PROFILE",
     )
     )
     args = parser.parse_args(argv)
     args = parser.parse_args(argv)
+    supported = {"control", "identification", "host_protocol"}
+    invalid = [profile for profile in args.profiles if profile not in supported]
+    if invalid:
+        parser.error(f"unsupported profile: {invalid[0]}")
+    profiles = args.profiles or ("control", "identification", "host_protocol")
     stimulus = {"control": 0, "identification": 1, "host_protocol": 0}
     stimulus = {"control": 0, "identification": 1, "host_protocol": 0}
     with tempfile.TemporaryDirectory(prefix="prod2u-6400-cocotb-") as directory:
     with tempfile.TemporaryDirectory(prefix="prod2u-6400-cocotb-") as directory:
         root = Path(directory)
         root = Path(directory)
-        for profile in args.profiles:
+        for profile in profiles:
             run_profile(profile, stimulus[profile], root / profile)
             run_profile(profile, stimulus[profile], root / profile)
-    print(f"PASS: 6400 cocotb integration profiles: {', '.join(args.profiles)}")
+    print(f"PASS: 6400 cocotb integration profiles: {', '.join(profiles)}")
     return 0
     return 0