Skip to content

Commit f3cd800

Browse files
Sebastian-LarssonYIWENX14
authored andcommitted
Arm backend: Add .coveragerc file (#7542)
Arm backend: Add basic test coverage configuration file. Signed-off-by: Sebastian Larsson <[email protected]>
1 parent a3115ca commit f3cd800

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

backends/arm/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,28 @@ The you can run the tests with
122122
pytest -c /dev/null -v -n auto backends/arm/test --arm_quantize_io --arm_run_corstoneFVP
123123
```
124124

125+
### Code coverage
126+
127+
To get code coverage:
128+
129+
```
130+
coverage run --source=<SRC> --rcfile=backends/arm/test/.coveragerc -m pytest \
131+
--config-file=/dev/null backends/arm/test/
132+
```
133+
134+
All files in `SRC` and its child directories will be analysed for code coverage,
135+
unless explicitly exluded in the .coveragerc file. If using venv this might be
136+
under `env/lib/python<VERSION_NUMBER>/site-packages/executorch/`. To get the
137+
absolute path, run:
138+
139+
```
140+
python -c "import executorch; print(executorch.__path__)"
141+
```
142+
143+
This contains a list of paths where the source directory is located. Pick the
144+
one that is located in `env/lib`. If that does not work try the others. Add
145+
`backends/arm` to the path in `--source` to only get code coverage for the Arm
146+
backend.
125147

126148
### A note on unit tests
127149

backends/arm/test/.coveragerc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[run]
2+
omit =
3+
*__init__.py*
4+
5+
[report]
6+
skip_covered = true
7+
exclude_also =
8+
raise NotImplementedError

0 commit comments

Comments
 (0)