aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-11 15:38:53 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-11 15:38:53 +0200
commita36a27b8ca85adf57b2a9926a53e74e3a3863d3d (patch)
tree0cef6594264f1ebe2252f975514849c9a1262922 /src/test
parentfb0a727a9885b80b855f470ae6d5c1bfac614439 (diff)
downloadminishell_test-a36a27b8ca85adf57b2a9926a53e74e3a3863d3d.tar.gz
minishell_test-a36a27b8ca85adf57b2a9926a53e74e3a3863d3d.tar.bz2
minishell_test-a36a27b8ca85adf57b2a9926a53e74e3a3863d3d.zip
Added leak verbose
Diffstat (limited to 'src/test')
-rw-r--r--src/test/captured.py7
-rw-r--r--src/test/result.py4
-rw-r--r--src/test/test.py4
3 files changed, 11 insertions, 4 deletions
diff --git a/src/test/captured.py b/src/test/captured.py
index 4a9966d..15ef3f7 100644
--- a/src/test/captured.py
+++ b/src/test/captured.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 12:16:25 by charles #+# #+# #
-# Updated: 2020/10/07 18:25:05 by cacharle ### ########.fr #
+# Updated: 2020/10/11 08:44:36 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -21,8 +21,13 @@ class Captured:
files_content: content of the files altered by the command
is_timeout: the command has timed out
"""
+ # if config.PROMPT_OBJECT is not None:
+ # output = output.replace(config.PROMPT_OBJECT + "\n", "")
+ # output = output.replace(config.PROMPT_OBJECT, "")
lines = output.split('\n')
for i, l in enumerate(lines):
+ # if l.find(config.PROMPT_OBJECT) == 0:
+ # l.replace(config.PROMPT_OBJECT, "")
if l.find(config.REFERENCE_ERROR_BEGIN) == 0:
lines[i] = l.replace(config.REFERENCE_ERROR_BEGIN, config.MINISHELL_ERROR_BEGIN, 1)
elif l.find(config.REFERENCE_PATH + ": ") == 0:
diff --git a/src/test/result.py b/src/test/result.py
index 55cda54..e651e49 100644
--- a/src/test/result.py
+++ b/src/test/result.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 12:17:34 by charles #+# #+# #
-# Updated: 2020/10/09 11:04:16 by cacharle ### ########.fr #
+# Updated: 2020/10/11 14:09:24 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -98,7 +98,7 @@ class Result:
elif config.VERBOSE_LEVEL == 2:
return self.full_diff()
else:
- raise RuntimeError
+ raise RuntimeError("Invalid verbose level")
def put(self, index: int):
"""Print a summary of the result"""
diff --git a/src/test/test.py b/src/test/test.py
index b487f10..238ba66 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/10/09 11:00:57 by cacharle ### ########.fr #
+# Updated: 2020/10/11 14:09:04 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -61,6 +61,8 @@ class Test:
self.hook = []
self.hook_status = []
captured = self._run_sandboxed([*config.VALGRIND_CMD, "-c"])
+ if config.VERBOSE_LEVEL == 2:
+ print(captured.output)
self.result = Result.leak(self.full_cmd, captured.output)
self.result.put(index)
return