File parameter to NamedTestFactory
This commit is contained in:
@@ -32,7 +32,7 @@ public abstract class JetTestCaseBuilder {
|
||||
}
|
||||
|
||||
public interface NamedTestFactory {
|
||||
@NotNull Test createTest(@NotNull String dataPath, @NotNull String name);
|
||||
@NotNull Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -90,7 +90,7 @@ public abstract class JetTestCaseBuilder {
|
||||
String fileName = file.getName();
|
||||
assert fileName != null;
|
||||
String extension = fileName.endsWith(extensionJet) ? extensionJet : extensionKt;
|
||||
suite.addTest(factory.createTest(dataPath, fileName.substring(0, fileName.length() - extension.length())));
|
||||
suite.addTest(factory.createTest(dataPath, fileName.substring(0, fileName.length() - extension.length()), file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ public class JetControlFlowTest extends JetLiteFixture {
|
||||
suite.addTest(JetTestCaseBuilder.suiteForDirectory(JetTestCaseBuilder.getTestDataPathBase(), "/cfg/", true, new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetControlFlowTest(dataPath, name);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.ImportingStrategy;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaDefaultImports;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -167,7 +168,7 @@ public class JetDiagnosticsTest extends JetLiteFixture {
|
||||
return JetTestCaseBuilder.suiteForDirectory(JetTestCaseBuilder.getTestDataPathBase(), "/diagnostics/tests", true, new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetDiagnosticsTest(dataPath, name);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@ public class JetParsingTest extends ParsingTestCase {
|
||||
JetTestCaseBuilder.NamedTestFactory factory = new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetParsingTest(dataPath, name);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -157,7 +157,7 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
||||
return JetTestCaseBuilder.suiteForDirectory(getHomeDirectory() + "/compiler/testData/", "/resolve/", true, new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetResolveTest(dataPath + "/" + name + ".jet", name);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -58,21 +58,21 @@ public class JetPsiCheckerTest extends LightDaemonAnalyzerTestCase {
|
||||
JetTestCaseBuilder.appendTestsInDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/", false, JetTestCaseBuilder.emptyFilter, new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetPsiCheckerTest(dataPath, name);
|
||||
}
|
||||
}, suite);
|
||||
JetTestCaseBuilder.appendTestsInDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/regression/", false, JetTestCaseBuilder.emptyFilter, new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetPsiCheckerTest(dataPath, name);
|
||||
}
|
||||
}, suite);
|
||||
JetTestCaseBuilder.appendTestsInDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/infos/", false, JetTestCaseBuilder.emptyFilter, new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetPsiCheckerTest(dataPath, name).setCheckInfos(true);
|
||||
}
|
||||
}, suite);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class KeywordsCompletionTest extends JetCompletionTestBase {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public junit.framework.Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public junit.framework.Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new KeywordsCompletionTest(dataPath, name);
|
||||
}
|
||||
}, suite);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class JetQuickFixTest extends LightQuickFixTestCase {
|
||||
JetTestCaseBuilder.NamedTestFactory namedTestFactory = new JetTestCaseBuilder.NamedTestFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name) {
|
||||
public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) {
|
||||
return new JetQuickFixTest(dataPath, name);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user