diff options
author | 2015-05-12 15:05:58 +0000 | |
---|---|---|
committer | 2015-05-15 09:35:19 +0000 | |
commit | 68ac06d203bd7e9abbd79a2b6dfc42b80d121311 (patch) | |
tree | 74a9a857cba905cb11ab6fa37da0fa9684de8dd4 /src/main/java/com/google/devtools/build/lib/rules/test/TestTargetExecutionSettings.java | |
parent | 0d56b6cdc0d2177231a2c14ab4c33be40a3ae234 (diff) |
Make local TestStrategy bits rely less on runfiles manifests
TestStrategy#getLocalRunfilesDirectory(...) was using manifest names
to infer if the runfiles symlinks were created by comparing the name
of manifests. This is a bit confusing and adds unnecessary reliance
on manifests which we'd like to reduce. Instead get whether or not
we created the symlinks from the boolean that determines it.
--
MOS_MIGRATED_REVID=93414150
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/test/TestTargetExecutionSettings.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/test/TestTargetExecutionSettings.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetExecutionSettings.java b/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetExecutionSettings.java index 20ad8af5ec..1948a3b330 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetExecutionSettings.java +++ b/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetExecutionSettings.java @@ -26,6 +26,7 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.analysis.config.RunUnder; import com.google.devtools.build.lib.packages.TargetUtils; +import com.google.devtools.build.lib.vfs.Path; import java.util.List; @@ -41,17 +42,18 @@ public final class TestTargetExecutionSettings { private final RunUnder runUnder; private final Artifact runUnderExecutable; private final Artifact executable; - private final Artifact runfilesManifest; + private final boolean runfilesSymlinksCreated; + private final Path runfilesDir; private final Artifact runfilesInputManifest; private final Artifact instrumentedFileManifest; - TestTargetExecutionSettings(RuleContext ruleContext, RunfilesSupport runfiles, + TestTargetExecutionSettings(RuleContext ruleContext, RunfilesSupport runfilesSupport, Artifact executable, Artifact instrumentedFileManifest, int shards) { Preconditions.checkArgument(TargetUtils.isTestRule(ruleContext.getRule())); Preconditions.checkArgument(shards >= 0); BuildConfiguration config = ruleContext.getConfiguration(); - List<String> targetArgs = runfiles.getArgs(); + List<String> targetArgs = runfilesSupport.getArgs(); testArguments = targetArgs.isEmpty() ? config.getTestArguments() : ImmutableList.copyOf(Iterables.concat(targetArgs, config.getTestArguments())); @@ -62,8 +64,9 @@ public final class TestTargetExecutionSettings { this.testFilter = config.getTestFilter(); this.executable = executable; - this.runfilesManifest = runfiles.getRunfilesManifest(); - this.runfilesInputManifest = runfiles.getRunfilesInputManifest(); + this.runfilesSymlinksCreated = runfilesSupport.getCreateSymlinks(); + this.runfilesDir = runfilesSupport.getRunfilesDirectory(); + this.runfilesInputManifest = runfilesSupport.getRunfilesInputManifest(); this.instrumentedFileManifest = instrumentedFileManifest; } @@ -99,17 +102,14 @@ public final class TestTargetExecutionSettings { return executable; } - /** - * Returns the runfiles manifest for this test. - * - * <p>This returns either the input manifest outside of the runfiles tree, - * if blaze is run with --nobuild_runfile_links or the manifest inside the - * runfiles tree, if blaze is run with --build_runfile_links. - * - * @see com.google.devtools.build.lib.analysis.RunfilesSupport#getRunfilesManifest() - */ - public Artifact getManifest() { - return runfilesManifest; + /** @return whether or not the runfiles symlinks were created */ + public boolean getRunfilesSymlinksCreated() { + return runfilesSymlinksCreated; + } + + /** @return the directory of the runfiles */ + public Path getRunfilesDir() { + return runfilesDir; } /** |