Skip to content

Commit 9f6a603

Browse files
authored
Get extra TPLs from environment variable. (#1019)
Enabler of the work in usethesource/rascal-core-big-tests#5
1 parent 9fdf47b commit 9f6a603

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

  • rascal-lsp/src/main/rascal/lsp/lang/rascal/tests/rename

rascal-lsp/src/main/rascal/lsp/lang/rascal/tests/rename/TestUtils.rsc

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Location;
3737
import ParseTree;
3838
import Set;
3939
import String;
40+
import ValueIO;
4041

4142
import lang::rascal::\syntax::Rascal; // `Name`
4243

@@ -53,6 +54,7 @@ import util::Maybe;
5354
import util::Monitor;
5455
import util::PathConfig;
5556
import util::Reflective;
57+
import util::SystemAPI;
5658
import util::Util;
5759

5860
public LanguageFileConfig RASCAL_CONF = fileConfig();
@@ -322,19 +324,24 @@ bool testRename(str stmtsStr, int cursorAtOldNameOccurrence = 0, str oldName = "
322324
return false;
323325
}
324326
325-
public loc calculateRascalLib() {
326-
result = resolveLocation(|std:///|);
327-
if (/org.rascalmpl.library.?$/ := result.path) {
328-
return result.parent.parent.parent;
327+
public list[loc] calculateRascalLibs() {
328+
rascalLib = resolveLocation(|std:///|);
329+
if (/org.rascalmpl.library.?$/ := rascalLib.path) {
330+
rascalLib = rascalLib.parent.parent.parent;
329331
}
330-
return result;
332+
props = getSystemEnvironment();
333+
if (props["ADDITIONAL_TPLS"]?) {
334+
loc additionalTpls = readTextValueString(#loc, props["ADDITIONAL_TPLS"]);
335+
return [rascalLib, additionalTpls];
336+
}
337+
return [rascalLib];
331338
}
332339

333340

334341
public PathConfig getTestPathConfig(loc testDir) {
335342
return pathConfig(
336343
bin=testDir + "bin",
337-
libs=[calculateRascalLib()],
344+
libs=calculateRascalLibs(),
338345
srcs=[testDir + "rascal"]
339346
);
340347
}

0 commit comments

Comments
 (0)