Ability to change codegen test path (for plugins)

This commit is contained in:
Yan Zhulanow
2014-12-08 22:07:00 +03:00
parent 7cd78a2d3a
commit 23053a2be2
@@ -108,9 +108,14 @@ public abstract class CodegenTestCase extends UsefulTestCase {
loadFile(getPrefix() + "/" + getTestName(true) + ".kt");
}
@NotNull
protected String codegenTestBasePath() {
return "compiler/testData/codegen/";
}
@NotNull
protected String relativePath(@NotNull File file) {
String stringToCut = "compiler/testData/codegen/";
String stringToCut = codegenTestBasePath();
String systemIndependentPath = file.getPath().replace(File.separatorChar, '/');
assert systemIndependentPath.startsWith(stringToCut) : "File path is not absolute: " + file;
return systemIndependentPath.substring(stringToCut.length());