diff options
author | 2018-05-18 06:09:10 -0700 | |
---|---|---|
committer | 2018-05-18 06:10:25 -0700 | |
commit | fd0b85e5699852fa653a029520de0f62788e8328 (patch) | |
tree | 7a21e9da307475816bc016cd2c2b94a4d0aacdaa /src/main | |
parent | fa10e028739cc751b336e464e1c93d7d1531ac04 (diff) |
Move coverageSupport and coverageReportGenerator from BuildConfiguration to
TestConfiguration.
RELNOTES:none
PiperOrigin-RevId: 197135911
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java | 38 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java | 52 |
2 files changed, 53 insertions, 37 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java index e63c5db18f..ab616e5c90 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java @@ -630,38 +630,7 @@ public class BuildConfiguration implements BuildConfigurationApi { ) public boolean experimentalJavaCoverage; - @Option( - name = "coverage_support", - converter = LabelConverter.class, - defaultValue = "@bazel_tools//tools/test:coverage_support", - documentationCategory = OptionDocumentationCategory.TOOLCHAIN, - effectTags = { - OptionEffectTag.CHANGES_INPUTS, - OptionEffectTag.AFFECTS_OUTPUTS, - OptionEffectTag.LOADING_AND_ANALYSIS - }, - help = - "Location of support files that are required on the inputs of every test action " - + "that collects code coverage. Defaults to '//tools/test:coverage_support'." - ) - public Label coverageSupport; - @Option( - name = "coverage_report_generator", - converter = LabelConverter.class, - defaultValue = "@bazel_tools//tools/test:coverage_report_generator", - documentationCategory = OptionDocumentationCategory.TOOLCHAIN, - effectTags = { - OptionEffectTag.CHANGES_INPUTS, - OptionEffectTag.AFFECTS_OUTPUTS, - OptionEffectTag.LOADING_AND_ANALYSIS - }, - help = - "Location of the binary that is used to generate coverage reports. This must " - + "currently be a filegroup that contains a single file, the binary. Defaults to " - + "'//tools/test:coverage_report_generator'." - ) - public Label coverageReportGenerator; @Option( name = "build_runfile_manifests", @@ -994,12 +963,7 @@ public class BuildConfiguration implements BuildConfigurationApi { return host; } - @Override - public Map<String, Set<Label>> getDefaultsLabels() { - return ImmutableMap.<String, Set<Label>>of( - "coverage_support", ImmutableSet.of(coverageSupport), - "coverage_report_generator", ImmutableSet.of(coverageReportGenerator)); - } + } private final String checksum; diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java index 026263cff3..6247fde3cc 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java @@ -14,10 +14,12 @@ package com.google.devtools.build.lib.analysis.test; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.devtools.build.lib.analysis.config.BuildConfiguration.Fragment; +import com.google.devtools.build.lib.analysis.config.BuildConfiguration.LabelConverter; import com.google.devtools.build.lib.analysis.config.BuildOptions; import com.google.devtools.build.lib.analysis.config.ConfigurationFragmentFactory; import com.google.devtools.build.lib.analysis.config.FragmentOptions; @@ -35,6 +37,8 @@ import com.google.devtools.common.options.OptionsParsingException; import com.google.devtools.common.options.TriState; import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.Set; /** Test-related options. */ @AutoCodec @@ -132,6 +136,46 @@ public class TestConfiguration extends Fragment { + "This option can be passed multiple times. " ) public List<PerLabelOptions> runsPerTest; + + @Option( + name = "coverage_support", + converter = LabelConverter.class, + defaultValue = "@bazel_tools//tools/test:coverage_support", + documentationCategory = OptionDocumentationCategory.TOOLCHAIN, + effectTags = { + OptionEffectTag.CHANGES_INPUTS, + OptionEffectTag.AFFECTS_OUTPUTS, + OptionEffectTag.LOADING_AND_ANALYSIS + }, + help = + "Location of support files that are required on the inputs of every test action " + + "that collects code coverage. Defaults to '//tools/test:coverage_support'." + ) + public Label coverageSupport; + + @Option( + name = "coverage_report_generator", + converter = LabelConverter.class, + defaultValue = "@bazel_tools//tools/test:coverage_report_generator", + documentationCategory = OptionDocumentationCategory.TOOLCHAIN, + effectTags = { + OptionEffectTag.CHANGES_INPUTS, + OptionEffectTag.AFFECTS_OUTPUTS, + OptionEffectTag.LOADING_AND_ANALYSIS + }, + help = + "Location of the binary that is used to generate coverage reports. This must " + + "currently be a filegroup that contains a single file, the binary. Defaults to " + + "'//tools/test:coverage_report_generator'." + ) + public Label coverageReportGenerator; + + @Override + public Map<String, Set<Label>> getDefaultsLabels() { + return ImmutableMap.<String, Set<Label>>of( + "coverage_support", ImmutableSet.of(coverageSupport), + "coverage_report_generator", ImmutableSet.of(coverageReportGenerator)); + } } /** Configuration loader for test options */ @@ -187,6 +231,14 @@ public class TestConfiguration extends Fragment { return options.testShardingStrategy; } + public Label getCoverageSupport(){ + return options.coverageSupport; + } + + public Label getCoverageReportGenerator(){ + return options.coverageReportGenerator; + } + /** * @return number of times the given test should run. If the test doesn't match any of the * filters, runs it once. |