File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,29 @@ Or discover and run many tests:
71
71
python -m unittest discover -s backends/arm/test/ops/
72
72
```
73
73
74
+ ### Code coverage
75
+
76
+ To get code coverage:
77
+
78
+ ```
79
+ coverage run --source=<SRC> --rcfile=backends/arm/test/.coveragerc -m pytest \
80
+ --config-file=/dev/null backends/arm/test/
81
+ ```
82
+
83
+ All files in ` SRC ` and its child directories will be analysed for code coverage,
84
+ unless explicitly exluded in the .coveragerc file. If using venv this might be
85
+ under ` env/lib/python<VERSION_NUMBER>/site-packages/executorch/ ` . To get the
86
+ absolute path, run:
87
+
88
+ ```
89
+ python -c "import executorch; print(executorch.__path__)"
90
+ ```
91
+
92
+ This contains a list of paths where the source directory is located. Pick the
93
+ one that is located in ` env/lib ` . If that does not work try the others. Add
94
+ ` backends/arm ` to the path in ` --source ` to only get code coverage for the Arm
95
+ backend.
96
+
74
97
### A note on unit tests
75
98
76
99
There are currently 3 ways we unit test our code.
Original file line number Diff line number Diff line change
1
+ [run]
2
+ omit =
3
+ *__init__.py*
4
+
5
+ [report]
6
+ skip_covered = true
7
+ exclude_also =
8
+ raise NotImplementedError
You can’t perform that action at this time.
0 commit comments