Fix TopLevelMembersInvocationTestGenerated.testTwoModules test.
This commit is contained in:
+13
-4
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.ConfigurationKind;
|
||||
@@ -32,9 +33,12 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractTopLevelMembersInvocationTest extends AbstractBytecodeTextTest {
|
||||
|
||||
private static final String LIBRARY = "library";
|
||||
|
||||
@Override
|
||||
public void doTest(@NotNull String filename) throws Exception {
|
||||
final File root = new File(filename);
|
||||
File root = new File(filename);
|
||||
final List<String> sourceFiles = new ArrayList<String>(2);
|
||||
|
||||
FileUtil.processFilesRecursively(root, new Processor<File>() {
|
||||
@@ -44,11 +48,16 @@ public abstract class AbstractTopLevelMembersInvocationTest extends AbstractByte
|
||||
sourceFiles.add(file.getPath().substring("compiler/testData/codegen/".length()));
|
||||
return true;
|
||||
}
|
||||
return FileUtil.filesEqual(file, root);
|
||||
return true;
|
||||
}
|
||||
}, new Processor<File>() {
|
||||
@Override
|
||||
public boolean process(File file) {
|
||||
return !LIBRARY.equals(file.getName());
|
||||
}
|
||||
});
|
||||
|
||||
File library = new File(root, "library");
|
||||
File library = new File(root, LIBRARY);
|
||||
List<File> classPath = library.exists() ?
|
||||
Collections.singletonList(MockLibraryUtil.compileLibraryToJar(library.getPath())) :
|
||||
Collections.<File>emptyList();
|
||||
@@ -59,7 +68,7 @@ public abstract class AbstractTopLevelMembersInvocationTest extends AbstractByte
|
||||
myEnvironment = JetCoreEnvironment.createForTests(getTestRootDisposable(), JetTestUtils.compilerConfigurationForTests(
|
||||
ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, Arrays.asList(JetTestUtils.getAnnotationsJar()), classPath));
|
||||
|
||||
loadFiles(sourceFiles.toArray(new String[sourceFiles.size()]));
|
||||
loadFiles(ArrayUtil.toStringArray(sourceFiles));
|
||||
|
||||
List<OccurrenceInfo> expected = readExpectedOccurrences("compiler/testData/codegen/" + sourceFiles.get(0));
|
||||
countAndCompareActualOccurrences(expected);
|
||||
|
||||
Reference in New Issue
Block a user