Set Bazel TEST_SRCDIR to runfiles root, not inside runfiles prefix.

--
MOS_MIGRATED_REVID=88739509
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 fca0e6d..8a6adc2 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.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 @@
 
     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 @@
   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;