aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar Ross Light <light@google.com>2015-03-16 17:27:48 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-03-18 13:39:44 +0000
commitef03359be57475e434f82ab39de4663ca880c035 (patch)
tree56803b8e2a73c922d6f5dc2b162d252eca97a4c2 /src/main/java/com/google/devtools/build
parentf00fb947f3728fc9db3a45eeda99de713c835f2c (diff)
Set Bazel TEST_SRCDIR to runfiles root, not inside runfiles prefix.
-- MOS_MIGRATED_REVID=88739509
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java
index fca0e6d462..8a6adc2e07 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java
@@ -33,6 +33,7 @@ import com.google.devtools.build.lib.events.Reporter;
import com.google.devtools.build.lib.util.io.FileOutErr;
import com.google.devtools.build.lib.vfs.FileSystemUtils;
import com.google.devtools.build.lib.vfs.Path;
+import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.view.test.TestStatus.BlazeTestStatus;
import com.google.devtools.build.lib.view.test.TestStatus.TestCase;
import com.google.devtools.build.lib.view.test.TestStatus.TestResultData;
@@ -121,7 +122,7 @@ public class StandaloneTestStrategy extends TestStrategy {
vars.putAll(config.getDefaultShellEnvironment());
vars.putAll(action.getTestEnv());
- vars.put("TEST_SRCDIR", runfilesDir.getRelative(action.getRunfilesPrefix()).getPathString());
+ vars.put("TEST_SRCDIR", runfilesDir.getPathString());
// TODO(bazel-team): set TEST_TMPDIR.
@@ -219,9 +220,11 @@ public class StandaloneTestStrategy extends TestStrategy {
private List<String> getArgs(TestRunnerAction action) {
List<String> args = Lists.newArrayList(TEST_SETUP);
TestTargetExecutionSettings execSettings = action.getExecutionSettings();
+ PathFragment prefix = new PathFragment(action.getRunfilesPrefix());
+ PathFragment executable = execSettings.getExecutable().getRootRelativePath();
// Execute the test using the alias in the runfiles tree.
- args.add(execSettings.getExecutable().getRootRelativePath().getPathString());
+ args.add(prefix.getRelative(executable).getPathString());
args.addAll(execSettings.getArgs());
return args;