diff options
Diffstat (limited to 'src/main/java')
3 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java index 2bd7daf1b9..d75f64a566 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java @@ -166,6 +166,11 @@ public class BaseRuleClasses { .add(attr("args", STRING_LIST)) // Input files for every test action .add( + attr("$test_wrapper", LABEL) + .cfg(HostTransition.INSTANCE) + .singleArtifact() + .value(env.getToolsLabel("//tools/test:test_wrapper"))) + .add( attr("$test_runtime", LABEL_LIST) .cfg(HostTransition.INSTANCE) .value(ImmutableList.of(env.getToolsLabel("//tools/test:runtime")))) diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java index fffbe7a5ea..4a99825d6d 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java @@ -166,6 +166,11 @@ public class SkylarkRuleClassFunctions implements SkylarkRuleFunctionsApi<Artifa .add(attr("args", STRING_LIST)) // Input files for every test action .add( + attr("$test_wrapper", LABEL) + .cfg(HostTransition.INSTANCE) + .singleArtifact() + .value(labelCache.getUnchecked(toolsRepository + "//tools/test:test_wrapper"))) + .add( attr("$test_runtime", LABEL_LIST) .cfg(HostTransition.INSTANCE) .value( 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 0d2f85b1cb..fe60cc1f39 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 @@ -216,6 +216,23 @@ public class TestConfiguration extends Fragment { ) public Label coverageReportGenerator; + @Option( + name = "windows_native_test_wrapper", + // Undocumented: this features is under development and not yet ready for production use. + // We define the flag to be able to test the feature. + // Design: + // https://github.com/laszlocsomor/proposals/blob/win-test-runner/designs/2018-07-18-windows-native-test-runner.md + documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, + // Affects loading and analysis: this flag affects which target Bazel loads and creates test + // actions with on Windows. + effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS}, + defaultValue = "false", + help = + "Do not use yet, this flag's functionality is not yet implemented. " + + "(On Windows: if true, uses the C++ test wrapper to run tests, otherwise uses " + + "tools/test/test-setup.sh as on other platforms. On other platforms: no-op.)") + public boolean windowsNativeTestWrapper; + @Override public Map<String, Set<Label>> getDefaultsLabels() { return ImmutableMap.<String, Set<Label>>of( @@ -298,6 +315,10 @@ public class TestConfiguration extends Fragment { return options.coverageReportGenerator; } + public boolean isUsingWindowsNativeTestWrapper() { + return options.windowsNativeTestWrapper; + } + /** * @return number of times the given test should run. If the test doesn't match any of the * filters, runs it once. |