From 372f432cda719dab45ebc50464f448017beacbe1 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 13 Sep 2020 12:03:45 +0200 Subject: Added env variable for reference shell arguments --- src/config.py | 4 ++-- src/main.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/config.py b/src/config.py index 7092fea..ab5a922 100644 --- a/src/config.py +++ b/src/config.py @@ -6,7 +6,7 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:19 by charles #+# #+# # -# Updated: 2020/09/12 16:56:23 by charles ### ########.fr # +# Updated: 2020/09/13 11:48:55 by charles ### ########.fr # # # # ############################################################################ # @@ -31,7 +31,7 @@ MINISHELL_MAKE = True # path to reference shell (shell which will be compared minishell) # has to support the -c option (sh, bash and zsh support it) REFERENCE_PATH = "/bin/bash" -REFERENCE_ARGS = ["--posix"] +REFERENCE_ARGS = [] # ["--posix"] # log file path LOG_PATH = "result.log" diff --git a/src/main.py b/src/main.py index efdfc2f..1c652b6 100755 --- a/src/main.py +++ b/src/main.py @@ -50,6 +50,10 @@ def main(): shutil.copy(distutils.spawn.find_executable(cmd), os.path.join(config.EXECUTABLES_PATH, cmd)) + reference_args = os.environ.get("MINISHELL_TEST_ARGS") + if reference_args is not None: + config.REFERENCE_ARGS.extend(reference_args.split(',')) + config.VERBOSE_LEVEL = args.verbose if args.bonus or os.environ.get("MINISHELL_TEST_BONUS") == "yes": config.BONUS = True -- cgit