aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-02-24 08:07:32 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-02-24 08:07:32 +0100
commite2237933447acd5e3910116da1a66c77fe6b29c3 (patch)
treed7f697cee1d71c8a1628c0b09c1cd499c2e36ba8
parent72e316d971d31a1d62b9a7019ceac1178657a55b (diff)
downloadminishell_test-e2237933447acd5e3910116da1a66c77fe6b29c3.tar.gz
minishell_test-e2237933447acd5e3910116da1a66c77fe6b29c3.tar.bz2
minishell_test-e2237933447acd5e3910116da1a66c77fe6b29c3.zip
Updated README instructions
-rw-r--r--README.md34
-rw-r--r--minishell_test/args.py18
-rw-r--r--setup.cfg4
3 files changed, 25 insertions, 31 deletions
diff --git a/README.md b/README.md
index 74b199e..7d9212f 100644
--- a/README.md
+++ b/README.md
@@ -17,18 +17,19 @@ $ pip3 install minishell-test
```
$ git clone https://github.com/cacharle/minishell_test
$ cd minishell_test
-$ pip3 install -e minishell_test
+$ pip3 install -e .
```
## Usage
-The default path to your project is `../minishell` but you can change it the the [configuration](src/config.py).
-
```
-$ ./run # run all tests
+$ minishell_test # In your project directory
+$ python3 -m minishell_test # If you don't have ~/.brew/bin or ~/.local/bin in your PATH
-$ ./run --help
-usage: run [-h] [-k] [-r BEGIN END] [--show-range] [-x] [-v] [-b] [-n] [-l] [-m] [-g] [suite ...]
+$ minishell_test --help
+usage: minishell_test [-h] [-p PATH] [-l] [-k] [-r BEGIN END] [--show-range]
+ [-x] [-v] [-b] [-n] [-m] [-g]
+ [suite [suite ...]]
Test for the minishell project of school 42.
@@ -39,6 +40,8 @@ positional arguments:
optional arguments:
-h, --help show this help message and exit
+ -p PATH, --path PATH Path to minishell directory
+ -l, --list Print available test suites
-k, --check-leaks Run valgrind on tests (disable usual comparison with bash)
-r BEGIN END, --range BEGIN END
Range of test index to run (imply --show-index)
@@ -47,13 +50,8 @@ optional arguments:
-v, --verbose Increase verbosity level (e.g -vv == 2)
-b, --bonus Enable bonus tests
-n, --no-bonus Disable bonus tests
- -l, --list Print available test suites
-m, --make Make minishell and exit
-g, --pager After running the test, display the result in a pager of your choice
-
-Made by cacharle
-https://github.com/cacharle
-https://cacharle.xyz
```
## Test compatibility
@@ -75,8 +73,6 @@ README.md test.sh
With this setup `argv[2]` is what you would usually get in `line` from `get_next_line`.
This allows you to set the prompt to whatever you want.
-**This test works with Python3.6 or higher.**
-
### Environement variables
My test only gives the `PATH=minishell_test/bin` and `TERM=xterm-256color` environment variables to your minishell.
@@ -85,16 +81,14 @@ You can test this quickly with the [try](try) script (e.g `./try 'echo bonjour |
## 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
+* Force the bonus tests with `$ minishell_test -b`
+* Change the `BONUS` variable in [config.py](minishell_test/config.py) to True
* Set the environment variable `MINISHELL_TEST_BONUS` to `yes`
(e.g `echo 'export MINISHELL_TEST_BONUS=yes' >> ~/.zshrc`)
## Memory leaks
-`./run -k`, checkout the `--show-range`, `--range` and `-x` options to help
+`$ minishell_test -k`, checkout the `--show-range`, `--range` and `-x` options to help
to select the tests to run since valgrind is really slow.
## Don't check error messages
@@ -111,7 +105,7 @@ The tester will try to convert to output/status code of bash on Linux to the one
## Add new tests
-You can find the suites in the [src/suites](src/suites) directory.
+You can find the suites in the [minishell\_test/suites](minishell_test/suites) directory.
### Add individual test
@@ -152,5 +146,5 @@ def suite_yoursuitename(test):
## Wildcard (or glob)
-There is a commented glob suite in [src/suites/preprocess.py](src/suites/preprocess.py).
+There is a commented glob suite in [minishell\_test/suites/preprocess.py](minishell_test/suites/preprocess.py).
Good luck handling `*'.*'`.
diff --git a/minishell_test/args.py b/minishell_test/args.py
index 3dd124f..e88ae7f 100644
--- a/minishell_test/args.py
+++ b/minishell_test/args.py
@@ -6,7 +6,7 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:24:32 by charles #+# #+# #
-# Updated: 2021/02/05 20:38:28 by charles ### ########.fr #
+# Updated: 2021/02/24 08:03:17 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -27,6 +27,14 @@ def parse_args():
""")
)
parser.add_argument(
+ "-p", "--path", default=config.MINISHELL_DIR,
+ help="Path to minishell directory"
+ )
+ parser.add_argument(
+ "-l", "--list", action="store_true",
+ help="Print available test suites"
+ )
+ parser.add_argument(
"-k", "--check-leaks", action="store_true",
help="Run valgrind on tests (disable usual comparison with bash)"
)
@@ -55,10 +63,6 @@ def parse_args():
help="Disable bonus tests"
)
parser.add_argument(
- "-l", "--list", action="store_true",
- help="Print available test suites"
- )
- parser.add_argument(
"-m", "--make", action="store_true",
help="Make minishell and exit"
)
@@ -67,10 +71,6 @@ def parse_args():
help="After running the test, display the result in a pager of your choice"
)
parser.add_argument(
- "-p", "--path", default=config.MINISHELL_DIR,
- help="Path to minishell directory"
- )
- parser.add_argument(
"suites", nargs='*', metavar="suite",
help=textwrap.dedent("""\
Test suites/group to run.
diff --git a/setup.cfg b/setup.cfg
index 535977c..9eea9b7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = minishell_test
-version = 1.0.0
+version = 1.0.1
license = GPL2
license_file = LICENSE
description = test for the minishell project of school 42
@@ -30,7 +30,7 @@ python_requires = >=3.6
[options.entry_points]
console_scripts =
- minishell-test = minishell_test.__main__:main
+ minishell_test = minishell_test.__main__:main
[flake8]
ignore = E501,E221,W504,E241