-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix identical gcov json file name problem #16527
Fix identical gcov json file name problem #16527
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor thing, but otherwise LGTM.
coverage_srcs/different/a.cc coverage_srcs/different/a.o \ | ||
coverage_srcs/t.cc coverage_srcs/t.o | ||
|
||
find . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should drop the find; it clutters the logs when there are failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
**The problem:** Bazel moves all `.gcov.json.gz` files to one directory. If in a test target, two source files have identical names, then the second `.gcov.json.gz` overwrites the first one. **The solution:** I added `gcno_path` to the move destination in order to distinguish multiple `.gcov.json.gz` with the same name. **Testing:** In the `test_cc_test_coverage_gcov` test case I added the `different/a.cc` source file, so currently we have the following source tree: ``` coverage_srcs/a.h coverage_srcs/a.cc coverage_srcs/b.h coverage_srcs/t.cc coverage_srcs/different/a.h coverage_srcs/different/a.cc ``` gcda and gcno files are created next to the source files. The final `gcov.json` files are placed in the corresponding paths: ``` $COVERAGE_DIR_VAR/coverage_srcs/*a.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/*t.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/different/*a.gcov.json.gz ``` Closes bazelbuild#16527. PiperOrigin-RevId: 483911427 Change-Id: I1608407e4b7264fb5fd436997bdc344344932b97
**The problem:** Bazel moves all `.gcov.json.gz` files to one directory. If in a test target, two source files have identical names, then the second `.gcov.json.gz` overwrites the first one. **The solution:** I added `gcno_path` to the move destination in order to distinguish multiple `.gcov.json.gz` with the same name. **Testing:** In the `test_cc_test_coverage_gcov` test case I added the `different/a.cc` source file, so currently we have the following source tree: ``` coverage_srcs/a.h coverage_srcs/a.cc coverage_srcs/b.h coverage_srcs/t.cc coverage_srcs/different/a.h coverage_srcs/different/a.cc ``` gcda and gcno files are created next to the source files. The final `gcov.json` files are placed in the corresponding paths: ``` $COVERAGE_DIR_VAR/coverage_srcs/*a.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/*t.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/different/*a.gcov.json.gz ``` Closes #16527. PiperOrigin-RevId: 483911427 Change-Id: I1608407e4b7264fb5fd436997bdc344344932b97
**The problem:** Bazel moves all `.gcov.json.gz` files to one directory. If in a test target, two source files have identical names, then the second `.gcov.json.gz` overwrites the first one. **The solution:** I added `gcno_path` to the move destination in order to distinguish multiple `.gcov.json.gz` with the same name. **Testing:** In the `test_cc_test_coverage_gcov` test case I added the `different/a.cc` source file, so currently we have the following source tree: ``` coverage_srcs/a.h coverage_srcs/a.cc coverage_srcs/b.h coverage_srcs/t.cc coverage_srcs/different/a.h coverage_srcs/different/a.cc ``` gcda and gcno files are created next to the source files. The final `gcov.json` files are placed in the corresponding paths: ``` $COVERAGE_DIR_VAR/coverage_srcs/*a.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/*t.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/different/*a.gcov.json.gz ``` Closes bazelbuild#16527. PiperOrigin-RevId: 483911427 Change-Id: I1608407e4b7264fb5fd436997bdc344344932b97
**The problem:** Bazel moves all `.gcov.json.gz` files to one directory. If in a test target, two source files have identical names, then the second `.gcov.json.gz` overwrites the first one. **The solution:** I added `gcno_path` to the move destination in order to distinguish multiple `.gcov.json.gz` with the same name. **Testing:** In the `test_cc_test_coverage_gcov` test case I added the `different/a.cc` source file, so currently we have the following source tree: ``` coverage_srcs/a.h coverage_srcs/a.cc coverage_srcs/b.h coverage_srcs/t.cc coverage_srcs/different/a.h coverage_srcs/different/a.cc ``` gcda and gcno files are created next to the source files. The final `gcov.json` files are placed in the corresponding paths: ``` $COVERAGE_DIR_VAR/coverage_srcs/*a.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/*t.gcov.json.gz $COVERAGE_DIR_VAR/coverage_srcs/different/*a.gcov.json.gz ``` Closes #16527. PiperOrigin-RevId: 483911427 Change-Id: I1608407e4b7264fb5fd436997bdc344344932b97
The problem:
Bazel moves all
.gcov.json.gz
files to one directory. If in a test target, two source files have identical names, then the second.gcov.json.gz
overwrites the first one.The solution:
I added
gcno_path
to the move destination in order to distinguish multiple.gcov.json.gz
with the same name.Testing:
In the
test_cc_test_coverage_gcov
test case I added thedifferent/a.cc
source file, so currently we have the following source tree:gcda and gcno files are created next to the source files. The final
gcov.json
files are placed in the corresponding paths: