diff options
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | config.py | 2 | ||||
| -rwxr-xr-x | main.py | 7 |
3 files changed, 10 insertions, 5 deletions
@@ -22,9 +22,9 @@ README.md test.sh README.md test.sh ``` -The reasons for this is are: -1. we're free to set the prompt to whatever we want -2. termcaps would be a nightmare to test +The reasons for this: +1. You're free to set the prompt to whatever you want +2. Termcaps would be a nightmare to test ## Run @@ -1,7 +1,7 @@ # Minishell configuration file # minishell dir path -MINISHELL_DIR = "/home/charles/minishell" +MINISHELL_DIR = ".." # minishell executable MINISHELL_EXEC = "minishell" @@ -35,18 +35,22 @@ def run_sandboxed(program: str, cmd: str) -> str: return output +status = 0 ignored_suites = [] suites = {} current_suite = "default" def test(cmd, setup = None, *files): + global status + if current_suite in ignored_suites: return expected = run_sandboxed(config.REFERENCE_SHELL_PATH, cmd) - actual = run_sandboxed(os.path.join(config.MINISHELL_DIR, config.MINISHELL_EXEC), cmd) + actual = run_sandboxed(os.path.abspath(os.path.join(config.MINISHELL_DIR, config.MINISHELL_EXEC)), cmd) if actual != expected: sys.stdout.write(red(config.FAIL_MARKER)) + status = 1 else: sys.stdout.write(green(config.PASS_MARKER)) sys.stdout.flush() @@ -76,3 +80,4 @@ def main(): if __name__ == "__main__": main() + sys.exit(status) |
