I wrote a few python tests that run cpp binaries as subprocess. Python code is in charge of performing tests on that process.
I run these python tests in py_test bazel rule. Problem is that this doesn't count as if our cpp code is covered with tests because py_test rule can only do test coverga for python files. Files used to generate coverage are .gcda files and those files are generated when we run bazel coverage test_name
. In our case the coverage of cpp files is impossible to do since tests are running as py_test and bazel has an open bug for that.
I tried to add copts = ["-fprofile-arcs","-ftest-coverage"]
and linkopts = ["-fprofile-arcs", "-lgcov --coverage"]
flags in cc_binary rule that builds cpp binaries (we test those executables with py_test), but the only thing that we manage to do is to get .gcno files (probably because our cc_binary is only built and not run).
Any idea how to get .gcda files or get coverage any other way?