Ability to change codegen test path (for plugins)
This commit is contained in:
@@ -108,9 +108,14 @@ public abstract class CodegenTestCase extends UsefulTestCase {
|
|||||||
loadFile(getPrefix() + "/" + getTestName(true) + ".kt");
|
loadFile(getPrefix() + "/" + getTestName(true) + ".kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
protected String codegenTestBasePath() {
|
||||||
|
return "compiler/testData/codegen/";
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
protected String relativePath(@NotNull File file) {
|
protected String relativePath(@NotNull File file) {
|
||||||
String stringToCut = "compiler/testData/codegen/";
|
String stringToCut = codegenTestBasePath();
|
||||||
String systemIndependentPath = file.getPath().replace(File.separatorChar, '/');
|
String systemIndependentPath = file.getPath().replace(File.separatorChar, '/');
|
||||||
assert systemIndependentPath.startsWith(stringToCut) : "File path is not absolute: " + file;
|
assert systemIndependentPath.startsWith(stringToCut) : "File path is not absolute: " + file;
|
||||||
return systemIndependentPath.substring(stringToCut.length());
|
return systemIndependentPath.substring(stringToCut.length());
|
||||||
|
|||||||
Reference in New Issue
Block a user