Skip to content

Arm backend: Add .coveragerc file #7542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions backends/arm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,28 @@ The you can run the tests with
pytest -c /dev/null -v -n auto backends/arm/test --arm_quantize_io --arm_run_corstoneFVP
```

### Code coverage

To get code coverage:

```
coverage run --source=<SRC> --rcfile=backends/arm/test/.coveragerc -m pytest \
--config-file=/dev/null backends/arm/test/
```

All files in `SRC` and its child directories will be analysed for code coverage,
unless explicitly exluded in the .coveragerc file. If using venv this might be
under `env/lib/python<VERSION_NUMBER>/site-packages/executorch/`. To get the
absolute path, run:

```
python -c "import executorch; print(executorch.__path__)"
```

This contains a list of paths where the source directory is located. Pick the
one that is located in `env/lib`. If that does not work try the others. Add
`backends/arm` to the path in `--source` to only get code coverage for the Arm
backend.

### A note on unit tests

Expand Down
8 changes: 8 additions & 0 deletions backends/arm/test/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[run]
omit =
*__init__.py*

[report]
skip_covered = true
exclude_also =
raise NotImplementedError
Loading