From 740b810ab1aaa3506d004d01f21e3cfc270fbcfc Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 13 Sep 2020 10:52:37 +0200 Subject: Added environment variable for bonus test --- README.md | 11 ++++++++++- src/main.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f60673c..8c0dd45 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Test for the minishell project of school 42. The default path to your project is `..` but you can change it the the [configuration](src/config.py). * `> ./run` - run all tests -* `> ./run [suite]...` - run specific test suites (e.g `./run builtin/echo`) +* `> ./run [suite]...` - run specific test suites (e.g `./run builtin/echo`) It tries to autocomplete your suite name so `./run int` -> `./run preprocess/interpolation` * `> ./run --help` - show the help * `> ./run -l` - list all suites and suites group @@ -32,6 +32,15 @@ README.md test.sh This allows you to set the prompt to whatever you want. +## Bonus + +Their is 3 different method to enable the bonus tests: + +* Force the bonus tests with `./run -b` +* Change the `BONUS` variable in [config.py](src/config.py) to True +* Set the environment variable `MINISHELL_TEST_BONUS` to `yes` + (e.g `echo 'export MINISHELL_TEST_BONUS=yes' >> ~/.zshrc`) + ## Python Version This test works with python >= 3.5. diff --git a/src/main.py b/src/main.py index 9b49ce8..efdfc2f 100755 --- a/src/main.py +++ b/src/main.py @@ -51,7 +51,7 @@ def main(): os.path.join(config.EXECUTABLES_PATH, cmd)) config.VERBOSE_LEVEL = args.verbose - if args.bonus: + if args.bonus or os.environ.get("MINISHELL_TEST_BONUS") == "yes": config.BONUS = True if args.no_bonus: config.BONUS = False -- cgit