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