diff options
-rw-r--r-- | jack-tests/.classpath | 2 | ||||
-rw-r--r-- | jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java | 27 | ||||
-rw-r--r-- | jack-tests/tests/com/android/jack/lookup/test001/lib/I.java | 23 | ||||
-rw-r--r-- | jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java | 23 | ||||
-rw-r--r-- | jack/tests/com/android/jack/AllTests.java | 1 | ||||
-rw-r--r-- | jack/tests/com/android/jack/LookupTest.java | 62 |
6 files changed, 137 insertions, 1 deletions
diff --git a/jack-tests/.classpath b/jack-tests/.classpath index 2d628b0..a8a949d 100644 --- a/jack-tests/.classpath +++ b/jack-tests/.classpath @@ -2,7 +2,7 @@ <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry excluding="com/android/jack/classpath/test002/lib1override/|com/android/jack/compiletime/|com/android/jack/enums/test003/link/Other.java|com/android/jack/enums/test003/link/Values.java|com/android/jack/error/test001/jack/A.java|com/android/jack/error/test002/jack/A.java|com/android/jack/java7/boxing/|com/android/jack/java7/exceptions/|com/android/jack/java7/parser/|com/android/jack/java7/switches/|com/android/jack/java7/trywithresources/|com/android/jack/nopackage/jack/" kind="src" path="tests"/> + <classpathentry excluding="com/android/jack/classpath/test002/lib1override/|com/android/jack/compiletime/|com/android/jack/enums/test003/link/Other.java|com/android/jack/enums/test003/link/Values.java|com/android/jack/error/test001/jack/A.java|com/android/jack/error/test002/jack/A.java|com/android/jack/java7/boxing/|com/android/jack/java7/exceptions/|com/android/jack/java7/parser/|com/android/jack/java7/switches/|com/android/jack/java7/trywithresources/|com/android/jack/nopackage/jack/|com/android/jack/lookup/test001/liboverride/" kind="src" path="tests"/> <classpathentry kind="lib" path="libs/junit4.jar"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java b/jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java new file mode 100644 index 0000000..0f5b196 --- /dev/null +++ b/jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.lookup.test001.jack; + +import com.android.jack.lookup.test001.lib.I; + +public class Invoking { + + public static void m(I i) { + i.m(); + } + +} diff --git a/jack-tests/tests/com/android/jack/lookup/test001/lib/I.java b/jack-tests/tests/com/android/jack/lookup/test001/lib/I.java new file mode 100644 index 0000000..536f5fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/lookup/test001/lib/I.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.lookup.test001.lib; + +public interface I { + + void m(); + +} diff --git a/jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java b/jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java new file mode 100644 index 0000000..ff506e4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.lookup.test001.lib; + +public abstract class I { + + public abstract void m(); + +} diff --git a/jack/tests/com/android/jack/AllTests.java b/jack/tests/com/android/jack/AllTests.java index d9fdbc6..b367f2c 100644 --- a/jack/tests/com/android/jack/AllTests.java +++ b/jack/tests/com/android/jack/AllTests.java @@ -86,6 +86,7 @@ import org.junit.runners.Suite.SuiteClasses; InnerTest.class, InvokesTest.class, JarjarTest.class, + LookupTest.class, MainTest.class, MarkerCollectorTest.class, MergerAllTests.class, diff --git a/jack/tests/com/android/jack/LookupTest.java b/jack/tests/com/android/jack/LookupTest.java new file mode 100644 index 0000000..ddb92b3 --- /dev/null +++ b/jack/tests/com/android/jack/LookupTest.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack; + +import com.android.jack.category.KnownBugs; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; + +public class LookupTest { + + @Category(KnownBugs.class) + @Test + public void test001() throws Exception { + File lib = TestTools.createTempDir("Lookup001Lib", ""); + TestTools.compileSourceToJack( + new Options(), + TestTools.getJackTestLibFolder("lookup/test001"), + TestTools.getDefaultBootclasspathString(), + lib, + false); + + File libOverride = TestTools.createTempDir("Lookup001LibOverride", ""); + TestTools.compileSourceToJack( + new Options(), + new File(TestTools.getJackTestFolder("lookup/test001"), "liboverride"), + TestTools.getDefaultBootclasspathString(), + libOverride, + false); + + File jacks = TestTools.createTempDir("Lookup001Jacks", ""); + TestTools.compileSourceToJack( + new Options(), + TestTools.getJackTestsWithJackFolder("lookup/test001"), + TestTools.getDefaultBootclasspathString() + File.pathSeparator + lib.getAbsolutePath(), + jacks, + false); + + Options options = new Options(); + options.addJayceImport(jacks); + options.addJayceImport(libOverride); + options.outZip = TestTools.createTempFile("Lookup001", ".zip"); + Jack.run(options); + } + +} |