aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDiego Russo <diego.russo@arm.com>2020-04-22 16:19:26 +0100
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commitc82b40c9fa3d1fc5239632efff1d99aad3b0a61e (patch)
tree70edd5753b183a425ec5a664b14f3c695bbde4ce /README.md
parente8a10454eba4c7392cb301fbfbe796e5bfb2b729 (diff)
downloadethos-u-vela-c82b40c9fa3d1fc5239632efff1d99aad3b0a61e.tar.gz
Add pytest/pytest-cov support for pre-commit
Pytest (testing framework) and pytest-cov are now part of the python environment and run automatically by pre-commit hook. Change-Id: If55cae9f29391c80c809a0487785786a7b9ae62a Signed-off-by: Diego Russo <diego.russo@arm.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/README.md b/README.md
index 4c779d56..3df86dc8 100644
--- a/README.md
+++ b/README.md
@@ -115,7 +115,7 @@ Vela is licensed under [Apache License 2.0](LICENSE.txt)
Contributions are accepted under Apache-2.0. Only submit contributions where you have authored all of the code.
-### Sanity checks
+### Sanity checks and tests
The Python codebase is PEP8 compliant with the exception of 120 characters line length.
We run reorder-python-import, black and flake8 against the code base excluding "ethosu/vela/tflite/" and "ethosu/vela/ethos\_u55\_regs" directories because they are auto-generated by third party tools.
@@ -130,6 +130,9 @@ pipenv install -e . --dev
```
After the installation, pre-commit is available in the virtual environment.
+Besides pre-commit, we install also:
+* pytest: testing framework
+* pytest-cov: code coverage plugin for pytest
#### Install the pre-commit hook
@@ -143,6 +146,16 @@ pre-commit installed at .git/hooks/pre-commit
The checks will be run before the commit: if one of them fails, you need to fix the code to make the checks pass.
+#### Run the tests
+
+Tests and test coverage can be run using pre-commit framework.
+
+```
+$ pre-commit run pytest
+...
+$ pre-commit run pytest-cov
+```
+
#### Run the sanity checks
Those checks can be run manually. This can be achievied running the following
@@ -160,4 +173,7 @@ $ pre-commit run --all-files
Reorder python imports...................................................Passed
black....................................................................Passed
flake8...................................................................Passed
+pytest...................................................................Passed
+...
+...
```