@@ -63,10 +63,12 @@ class YAMLTestRunner: |
| 63 | 63 | shell session across multiple tests, resetting state between them. |
| 64 | 64 | """ |
| 65 | 65 | |
| 66 | | - def __init__(self, shell_path: str, verbose: bool = False, tests_per_session: int = 10): |
| 66 | + def __init__(self, shell_path: str, verbose: bool = False, tests_per_session: int = 10, |
| 67 | + profile: dict = None): |
| 67 | 68 | self.shell_path = shell_path |
| 68 | 69 | self.verbose = verbose |
| 69 | 70 | self.results: List[TestResult] = [] |
| 71 | + self.profile = profile or {} |
| 70 | 72 | |
| 71 | 73 | # Scale timeouts for slower platforms (ARM64, macOS with flang-new) |
| 72 | 74 | import platform |
@@ -126,7 +128,8 @@ class YAMLTestRunner: |
| 126 | 128 | self._current_session = ShellPTY( |
| 127 | 129 | shell_path=self.shell_path, |
| 128 | 130 | timeout=self.pty_timeout, |
| 129 | | - env=env or {} |
| 131 | + env=env or {}, |
| 132 | + profile=self.profile, |
| 130 | 133 | ) |
| 131 | 134 | self._current_session.start(rc_file=rc_file) |
| 132 | 135 | else: |
@@ -163,7 +166,11 @@ class YAMLTestRunner: |
| 163 | 166 | |
| 164 | 167 | # Reset PS1 and editing mode, then echo marker |
| 165 | 168 | marker = f"RESET_{self._test_count}" |
| 166 | | - self._current_session.send_line(f" set -o emacs; PS1='> '; echo {marker}") # leading space to exclude from history |
| 169 | + # Build reset command from profile |
| 170 | + mode_reset = self.profile.get("mode_reset_command", "") |
| 171 | + prompt_set = self.profile.get("prompt_set_command", "PS1='$ '") |
| 172 | + reset_parts = [p for p in [mode_reset, prompt_set, f"echo {marker}"] if p] |
| 173 | + self._current_session.send_line(" " + "; ".join(reset_parts)) # leading space to exclude from history |
| 167 | 174 | |
| 168 | 175 | # Wait for the marker to ensure we're at a clean state |
| 169 | 176 | try: |