@@ -195,6 +195,25 @@ class YAMLTestRunner: |
| 195 | 195 | self._current_session = None |
| 196 | 196 | gc.collect() |
| 197 | 197 | |
| 198 | + def should_skip_spec(self, spec_path: Path) -> Optional[str]: |
| 199 | + """Check if a spec file should be skipped based on profile capabilities.""" |
| 200 | + skip_list = self.profile.get("suites", {}).get("skip", []) |
| 201 | + # Check if any skip pattern matches the spec path |
| 202 | + spec_str = str(spec_path) |
| 203 | + for pattern in skip_list: |
| 204 | + if pattern in spec_str: |
| 205 | + return pattern |
| 206 | + # Check capability requirements |
| 207 | + caps = self.profile.get("capabilities", {}) |
| 208 | + spec_name = spec_path.stem.lower() |
| 209 | + if "vi_mode" in spec_name and not caps.get("vi_mode", False): |
| 210 | + return "shell lacks vi_mode capability" |
| 211 | + if "completion" in spec_name and not caps.get("command_completion", False): |
| 212 | + return "shell lacks command_completion capability" |
| 213 | + if ("line_editing" in spec_name or "history" in spec_name) and not caps.get("readline", False): |
| 214 | + return "shell lacks readline capability" |
| 215 | + return None |
| 216 | + |
| 198 | 217 | def run_spec_file(self, spec_path: Path) -> List[TestResult]: |
| 199 | 218 | """ |
| 200 | 219 | Run all tests in a YAML spec file. |
@@ -205,6 +224,12 @@ class YAMLTestRunner: |
| 205 | 224 | Returns: |
| 206 | 225 | List of TestResult objects |
| 207 | 226 | """ |
| 227 | + # Check if this suite should be skipped for this shell |
| 228 | + skip_reason = self.should_skip_spec(spec_path) |
| 229 | + if skip_reason: |
| 230 | + print(f"\n{Fore.YELLOW}[SKIP]{Style.RESET_ALL} {spec_path.name} — {skip_reason}") |
| 231 | + return [] |
| 232 | + |
| 208 | 233 | with open(spec_path) as f: |
| 209 | 234 | spec = yaml.safe_load(f) |
| 210 | 235 | |