Skip to content

Commit

Permalink
Pass apple sdk information to ios_test test actions
Browse files Browse the repository at this point in the history
--
MOS_MIGRATED_REVID=106418732
  • Loading branch information
c-parsons authored and davidzchen committed Oct 27, 2015
1 parent 5356375 commit 3f344f3
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,19 @@ public TestSupport addRunfiles(Builder runfilesBuilder) throws InterruptedExcept
* builder.
*/
public Map<Class<? extends TransitiveInfoProvider>, TransitiveInfoProvider> getExtraProviders() {
ObjcConfiguration configuration = ruleContext.getFragment(ObjcConfiguration.class);

ImmutableMap.Builder<String, String> envBuilder = ImmutableMap.builder();

envBuilder.putAll(configuration.getEnvironmentForDarwin());

if (ruleContext.getConfiguration().isCodeCoverageEnabled()) {
return ImmutableMap.<Class<? extends TransitiveInfoProvider>, TransitiveInfoProvider>of(
TestEnvironmentProvider.class, new TestEnvironmentProvider(gcovEnv()));
envBuilder.put("COVERAGE_GCOV_PATH",
ruleContext.getHostPrerequisiteArtifact(":gcov").getExecPathString());
}
return ImmutableMap.of();
}

/**
* Returns a map of extra environment variable names to their values used to point to gcov binary,
* which should be added to the test action environment, if coverage is enabled.
*/
private ImmutableMap<String, String> gcovEnv() {
return ImmutableMap.of(
"COVERAGE_GCOV_PATH", ruleContext.getHostPrerequisiteArtifact(":gcov").getExecPathString());
return ImmutableMap.<Class<? extends TransitiveInfoProvider>, TransitiveInfoProvider>of(
TestEnvironmentProvider.class, new TestEnvironmentProvider(envBuilder.build()));
}

/**
Expand Down

0 comments on commit 3f344f3

Please sign in to comment.