Skip to content

Commit

Permalink
Remove empty coverage environment
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Dec 13, 2024
1 parent 164c482 commit 8eaf8e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/starlark/builtins_bzl/common/cc/cc_helper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ def _get_coverage_environment(ctx, cc_config, cc_toolchain):
}
for k in list(env.keys()):
if env[k] == None:
env[k] = ""
env.pop(k)
if cc_config.fdo_instrument():
env["FDO_DIR"] = cc_config.fdo_instrument()
return env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public void testGcovNotDefined() throws Exception {
getConfiguredTarget("//a:lib").get(InstrumentedFilesInfo.STARLARK_CONSTRUCTOR);

assertThat(instrumentedFilesInfo.getCoverageEnvironment())
.containsEntry("COVERAGE_GCOV_PATH", "");
.doesNotContainKey("COVERAGE_GCOV_PATH");
}

// regression test for b/319501294
Expand Down Expand Up @@ -496,7 +496,8 @@ public void testLlvmCoverageToolsNotDefined() throws Exception {
.get(InstrumentedFilesInfo.STARLARK_CONSTRUCTOR)
.getCoverageEnvironment();

assertThat(coverageEnv).containsAtLeast("LLVM_COV", "", "LLVM_PROFDATA", "");
assertThat(coverageEnv).doesNotContainKey("LLVM_COV");
assertThat(coverageEnv).doesNotContainKey("LLVM_PROFDATA");
}

@Test
Expand Down

0 comments on commit 8eaf8e8

Please sign in to comment.