Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ private static File findExecutable(Label target, List<File> outputs) {

// Matches TEST_SRCDIR=<dir>
private static final Pattern TEST_SRCDIR = Pattern.compile("TEST_SRCDIR=([^ ]+)");
// Matches RUNFILES_<NAME>=<value>
private static final Pattern RUNFILES_VAR = Pattern.compile("RUNFILES_([A-Z_]+)=([^ ]+)");
// Matches a space-delimited arg list. Supports wrapping arg in single quotes.
private static final Pattern ARGS = Pattern.compile("([^\']\\S*|\'.+?\')\\s*");

Expand Down Expand Up @@ -431,6 +433,10 @@ private static ExecutableInfo parseScriptPathFile(
throw new ExecutionException("Failed to parse args in script_path: " + scriptPath);
}
envVars.put("TEST_SRCDIR", testScrDir.group(1));
Matcher runfilesVars = RUNFILES_VAR.matcher(text);
while (runfilesVars.find()) {
envVars.put(String.format("RUNFILES_%s", runfilesVars.group(1)), runfilesVars.group(2));
}
workingDir = workspaceRoot.directory();
String workspaceName = execRoot.getName();
binary =
Expand Down