Library paths updated after migration to new stdlib generators

This commit is contained in:
Ilya Ryzhenkov
2014-03-17 19:20:12 +04:00
committed by Andrey Breslav
parent e37d8174c3
commit 06873e9d09
10 changed files with 59 additions and 51 deletions
@@ -44,15 +44,15 @@ public class NavigateToStdlibSourceRegressionTest extends NavigateToLibraryRegre
} }
public void testJavaClass() throws IOException { public void testJavaClass() throws IOException {
doNavigationInSourcesTest("libraries/stdlib/src/kotlin/Iterators.kt", "Collections", "java.util.Collections"); doNavigationInSourcesTest("libraries/stdlib/src/kotlin/collections/Maps.kt", "Collections", "java.util.Collections");
} }
public void testKotlinClass() throws IOException { public void testKotlinClass() throws IOException {
doNavigationInSourcesTest("libraries/stdlib/src/kotlin/Iterators.kt", "FunctionIterator", "kotlin.FunctionIterator"); doNavigationInSourcesTest("libraries/stdlib/src/kotlin/collections/Stream.kt", "AbstractIterator", "kotlin.support.AbstractIterator");
} }
public void testClassWithJavaAnalog() throws IOException { public void testClassWithJavaAnalog() throws IOException {
doNavigationInSourcesTest("libraries/stdlib/src/kotlin/Iterators.kt", "Iterator", "kotlin.Iterator"); doNavigationInSourcesTest("libraries/stdlib/src/kotlin/collections/AbstractIterator.kt", "Iterator", "kotlin.Iterator");
} }
public void testNavigationInKotlinBuiltIns() throws IOException { public void testNavigationInKotlinBuiltIns() throws IOException {
@@ -69,6 +69,10 @@ public class NavigateToStdlibSourceRegressionTest extends NavigateToLibraryRegre
PsiFile psiFile = getPsiFileForFileFromSources(file); PsiFile psiFile = getPsiFileForFileFromSources(file);
String text = psiFile.getText(); String text = psiFile.getText();
int index = text.indexOf(element); int index = text.indexOf(element);
assertNotSame(-1, "Cannot find text '" + element + "' in file " + path);
while (Character.isLetter(text.charAt(index - 1))) {
index = text.indexOf(element, index + 1);
}
PsiReference ref = psiFile.findReferenceAt(index); PsiReference ref = psiFile.findReferenceAt(index);
assertNotNull("Cannot find reference at " + index + ", " + assertNotNull("Cannot find reference at " + index + ", " +
text.substring(index - 20, index) + "<caret>" + text.substring(index, index + 20), ref); text.substring(index - 20, index) + "<caret>" + text.substring(index, index + 20), ref);
@@ -26,8 +26,8 @@ import org.jetbrains.jet.plugin.libraries.NavigateToStdlibSourceRegressionTest;
public class LightClassForLibrarySourceFileTest extends NavigateToStdlibSourceRegressionTest { public class LightClassForLibrarySourceFileTest extends NavigateToStdlibSourceRegressionTest {
public void testLightClassForFileFromLibrarySource() throws Exception { public void testLightClassForFileFromLibrarySource() throws Exception {
PsiElement navigationElement = getNavigationElement("libraries/stdlib/src/kotlin/Iterators.kt", "FunctionIterator"); PsiElement navigationElement = getNavigationElement("libraries/stdlib/src/kotlin/collections/Stream.kt", "AbstractIterator");
assertTrue("FunctionIterator should navigate to JetClassOrObject", navigationElement instanceof JetClassOrObject); assertTrue("AbstractIterator should navigate to JetClassOrObject", navigationElement instanceof JetClassOrObject);
PsiClass lightClass = LightClassUtil.getPsiClass((JetClassOrObject) navigationElement); PsiClass lightClass = LightClassUtil.getPsiClass((JetClassOrObject) navigationElement);
assertTrue("Do not create Kotlin Light Class for file from library sources", !(lightClass instanceof KotlinLightClass)); assertTrue("Do not create Kotlin Light Class for file from library sources", !(lightClass instanceof KotlinLightClass));
} }
@@ -21,6 +21,6 @@ import junit.framework.Test;
@SuppressWarnings("JUnitTestCaseWithNoTests") @SuppressWarnings("JUnitTestCaseWithNoTests")
public final class ArraysTest extends JsUnitTestBase { public final class ArraysTest extends JsUnitTestBase {
public static Test suite() throws Exception { public static Test suite() throws Exception {
return createTestSuiteForFile("libraries/stdlib/test/ArraysTest.kt"); return createTestSuiteForFile("libraries/stdlib/test/collections/ArraysTest.kt");
} }
} }
@@ -56,16 +56,16 @@ public class CompileMavenGeneratedJSLibrary extends SingleFileTranslationTest {
if (generatedJsLibraryDir.exists() && generatedJsLibraryDir.isDirectory()) { if (generatedJsLibraryDir.exists() && generatedJsLibraryDir.isDirectory()) {
generateJavaScriptFiles(DEFAULT_ECMA_VERSIONS, generateJavaScriptFiles(DEFAULT_ECMA_VERSIONS,
"libraries/stdlib/test", "libraries/stdlib/test",
"ArraysTest.kt", "collections/ArraysTest.kt",
"dom/DomTest.kt", "dom/DomTest.kt",
"js/MapTest.kt", "js/MapTest.kt",
"js/JsDomTest.kt", "js/JsDomTest.kt",
"iterators/FunctionIteratorTest.kt", "collections/FunctionIteratorTest.kt",
"iterators/IteratorsTest.kt", "collections/IteratorsTest.kt",
"GetOrElseTest.kt", "GetOrElseTest.kt",
"ListTest.kt", "collections/ListTest.kt",
"SetTest.kt", "collections/SetTest.kt",
"StringTest.kt"); "text/StringTest.kt");
} else { } else {
System.out.println("Warning " + generatedJsLibraryDir + " does not exist - I guess you've not run the maven build in library/ yet?"); System.out.println("Warning " + generatedJsLibraryDir + " does not exist - I guess you've not run the maven build in library/ yet?");
@@ -19,11 +19,9 @@ package org.jetbrains.k2js.test.semantics;
import junit.framework.Test; import junit.framework.Test;
@SuppressWarnings("JUnitTestCaseWithNoTests") @SuppressWarnings("JUnitTestCaseWithNoTests")
public final class StdLibSetTest extends JsUnitTestBase { public final class StdLibIterableTest extends JsUnitTestBase {
public static Test suite() throws Exception { public static Test suite() throws Exception {
return createTestSuiteForFile("libraries/stdlib/test/SetTest.kt", return createTestSuiteForFile("libraries/stdlib/test/collections/IterableTests.kt");
"SetTest.filter",
"SetTest.find");
} }
} }
@@ -22,7 +22,6 @@ import junit.framework.Test;
@SuppressWarnings("JUnitTestCaseWithNoTests") @SuppressWarnings("JUnitTestCaseWithNoTests")
public final class StdLibIteratorsTest extends JsUnitTestBase { public final class StdLibIteratorsTest extends JsUnitTestBase {
public static Test suite() throws Exception { public static Test suite() throws Exception {
return createTestSuiteForFile("libraries/stdlib/test/iterators/IteratorsTest.kt", return createTestSuiteForFile("libraries/stdlib/test/collections/IteratorsTest.kt");
"IteratorsTest.requireNoNulls");
} }
} }
@@ -22,6 +22,6 @@ import junit.framework.Test;
@SuppressWarnings("JUnitTestCaseWithNoTests") @SuppressWarnings("JUnitTestCaseWithNoTests")
public final class StdLibListTest extends JsUnitTestBase { public final class StdLibListTest extends JsUnitTestBase {
public static Test suite() throws Exception { public static Test suite() throws Exception {
return createTestSuiteForFile("libraries/stdlib/test/ListTest.kt"); return createTestSuiteForFile("libraries/stdlib/test/collections/ListSpecificTest.kt");
} }
} }
@@ -25,11 +25,11 @@ public class StdLibTestToJSTest extends StdLibTestBase {
"dom/DomTest.kt", "dom/DomTest.kt",
"js/MapJsTest.kt", "js/MapJsTest.kt",
"js/JsDomTest.kt", "js/JsDomTest.kt",
"iterators/FunctionIteratorTest.kt", "collections/StreamTest.kt",
"iterators/IteratorsTest.kt", "collections/IteratorsTest.kt",
"GetOrElseTest.kt", "GetOrElseTest.kt",
"ListTest.kt", "collections/ListSpecificTest.kt",
"SetTest.kt", "collections/IterableTests.kt",
"StringTest.kt"); "text/StringTest.kt");
} }
} }
@@ -102,7 +102,6 @@ public abstract class Config {
"/core/stringsCode.kt", "/core/stringsCode.kt",
"/stdlib/domCode.kt", "/stdlib/domCode.kt",
"/stdlib/jutilCode.kt", "/stdlib/jutilCode.kt",
"/stdlib/JUMapsCode.kt",
"/stdlib/testCode.kt" "/stdlib/testCode.kt"
); );
@@ -114,20 +113,30 @@ public abstract class Config {
@NotNull @NotNull
public static final List<String> STDLIB_FILE_NAMES = Arrays.asList( public static final List<String> STDLIB_FILE_NAMES = Arrays.asList(
"/kotlin/Preconditions.kt", "/kotlin/Preconditions.kt",
"/kotlin/Iterators.kt", "/kotlin/Functions.kt",
"/kotlin/JUtil.kt", "/kotlin/collections/JUtil.kt",
"/kotlin/Arrays.kt", "/kotlin/collections/Iterators.kt",
"/kotlin/Lists.kt", "/kotlin/collections/Arrays.kt",
"/kotlin/Maps.kt", "/kotlin/collections/Maps.kt",
"/kotlin/Exceptions.kt", "/kotlin/collections/Exceptions.kt",
"/kotlin/IterablesSpecial.kt", "/kotlin/collections/MutableCollections.kt",
"/kotlin/collections/Stream.kt",
"/kotlin/collections/AbstractIterator.kt",
"/generated/_Aggregates.kt",
"/generated/_Arrays.kt", "/generated/_Arrays.kt",
"/generated/_Collections.kt", "/generated/_DownTo.kt",
"/generated/_Iterables.kt", "/generated/_Elements.kt",
"/generated/_Iterators.kt", "/generated/_Filtering.kt",
"/kotlin/support/AbstractIterator.kt", "/generated/_Generators.kt",
"/generated/_Guards.kt",
"/generated/_Mapping.kt",
"/generated/_Numeric.kt",
"/generated/_Ordering.kt",
"/generated/_Snapshots.kt",
"/generated/_Strings.kt",
"/generated/_Streams.kt",
"/kotlin/Standard.kt", "/kotlin/Standard.kt",
"/kotlin/Strings.kt", "/kotlin/text/Strings.kt",
"/kotlin/dom/Dom.kt", "/kotlin/dom/Dom.kt",
"/kotlin/test/Test.kt" "/kotlin/test/Test.kt"
); );
+12 -14
View File
@@ -49,33 +49,31 @@
<include name="**/*.kt"/> <include name="**/*.kt"/>
<exclude name="**/*JVM.kt"/> <exclude name="**/*JVM.kt"/>
</fileset> </fileset>
<fileset dir="${basedir}/../../stdlib/src/kotlin/support">
<include name="**/*.kt"/>
<exclude name="**/*JVM.kt"/>
</fileset>
<fileset dir="${basedir}/../../stdlib/src/kotlin/test"> <fileset dir="${basedir}/../../stdlib/src/kotlin/test">
<include name="**/*.kt"/> <include name="**/*.kt"/>
<exclude name="**/*JVM.kt"/> <exclude name="**/*JVM.kt"/>
</fileset> </fileset>
<fileset dir="${basedir}/../../stdlib/src/kotlin"> <fileset dir="${basedir}/../../stdlib/src/kotlin">
<include name="Arrays.kt"/>
<include name="Preconditions.kt"/> <include name="Preconditions.kt"/>
<include name="Iterators.kt"/> <include name="Functions.kt"/>
<include name="JUtil.kt"/> <include name="Integers.kt"/>
<include name="Collections.kt"/> <include name="collections/AbstractIterator.kt"/>
<include name="Maps.kt"/> <include name="collections/Iterators.kt"/>
<include name="Iterables.kt"/> <include name="collections/Arrays.kt"/>
<include name="IterablesLazy.kt"/> <include name="collections/JUtil.kt"/>
<include name="IterablesSpecial.kt"/> <include name="collections/Maps.kt"/>
<include name="collections/Stream.kt"/>
<include name="collections/MutableCollections.kt"/>
<include name="Functions.kt"/>
<!-- <!--
<include name="Ordering.kt"/> <include name="Ordering.kt"/>
--> -->
<include name="Standard.kt"/> <include name="Standard.kt"/>
<include name="Strings.kt"/> <include name="text/Strings.kt"/>
</fileset> </fileset>
<fileset dir="${basedir}/../../stdlib/src/generated"> <fileset dir="${basedir}/../../stdlib/src/generated">
<include name="*.kt"/> <include name="*.kt"/>
<exclude name="**/*JVM.kt"/> <exclude name="*JVM.kt"/>
<exclude name="DownTo.kt"/> <exclude name="DownTo.kt"/>
<!-- <!--
<include name="IteratorsFromJLangIterables.kt"/> <include name="IteratorsFromJLangIterables.kt"/>