aboutsummaryrefslogtreecommitdiff
path: root/src/test/test.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-12 02:22:56 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-12 02:22:56 +0200
commit387fe3441d2f1f02b8ff85e798eb1295f95b7e7f (patch)
treeaf7c4f3449e3a4a23b813a0d9d42255b8c302c2b /src/test/test.py
parent958c410ba8b621a8a4d8caf04012028e7f151e0f (diff)
downloadminishell_test-387fe3441d2f1f02b8ff85e798eb1295f95b7e7f.tar.gz
minishell_test-387fe3441d2f1f02b8ff85e798eb1295f95b7e7f.tar.bz2
minishell_test-387fe3441d2f1f02b8ff85e798eb1295f95b7e7f.zip
Added suite name autocompletion
Diffstat (limited to 'src/test/test.py')
-rw-r--r--src/test/test.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test.py b/src/test/test.py
index 054086a..b5abd85 100644
--- a/src/test/test.py
+++ b/src/test/test.py
@@ -6,7 +6,7 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/06/16 21:48:50 by charles #+# #+# #
-# Updated: 2020/09/11 20:39:52 by charles ### ########.fr #
+# Updated: 2020/09/12 01:35:46 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -50,8 +50,8 @@ class Test:
def run(self):
"""Run the test for minishell and the reference shell and print the result out"""
- expected = self._run_sandboxed(config.REFERENCE_PATH, "-c")
- actual = self._run_sandboxed(config.MINISHELL_PATH, "-c")
+ expected = self._run_sandboxed(config.REFERENCE_PATH, config.REFERENCE_ARGS + ["-c"])
+ actual = self._run_sandboxed(config.MINISHELL_PATH, ["-c"])
s = self.cmd
if self.setup != "":
s = "[SETUP {}] {}".format(self.setup, s)
@@ -61,7 +61,7 @@ class Test:
self.result = Result(s, self.files, expected, actual)
self.result.put()
- def _run_sandboxed(self, shell_path: str, shell_option: str) -> Captured:
+ def _run_sandboxed(self, shell_path: str, shell_options: str) -> Captured:
""" Run the command in a sandbox environment
Capture the output (stdout and stderr)
Capture the content of the watched files after the command is run
@@ -88,7 +88,7 @@ class Test:
# run the command in the sandbox
process = subprocess.Popen(
- [shell_path, shell_option, self.cmd],
+ [shell_path, *shell_options, self.cmd],
stderr=subprocess.STDOUT,
stdout=subprocess.PIPE,
cwd=config.SANDBOX_PATH,