You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The serialized `.cov` files store file paths relative to a base path (the common path prefix of all covered files).
74
+
When generating reports, the source files must be readable so that they can be analysed.
75
+
76
+
If you are merging `.cov` files on a different machine than where the tests were run, and the source code is located at a different path, use `--source` to specify where the source code is on the current machine:
The command exits with code `0` when all changed executable lines are covered.
121
+
It exits with `1` when some changed executable lines are not covered.
122
+
It exits with `2` when no changed executable lines could be detected. This usually indicates a path mismatch.
123
+
124
+
#### The `--path-prefix` option
125
+
126
+
The `--path-prefix` option is needed when the file paths in the patch do not match the file paths in the coverage data.
127
+
128
+
The serialized `.cov` file stores file paths relative to a base path.
129
+
The patch file contains paths relative to wherever `git diff` (or equivalent) was run.
130
+
When both are relative to the same project root directory, which is the common case, they match and `--path-prefix` is not needed.
131
+
132
+
When the paths do not match, `--path-prefix` specifies the directory to prepend to the paths in the patch so that they can be resolved against the coverage data.
133
+
For example, if the diff was generated from a parent directory and contains paths like `project/src/Foo.php`, but the coverage data has paths relative to the project root (`src/Foo.php`), you would use:
0 commit comments