summaryrefslogtreecommitdiffstats
path: root/jack/tests
diff options
context:
space:
mode:
authorYohann Roussel <yroussel@google.com>2014-10-21 16:58:00 +0200
committerYohann Roussel <yroussel@google.com>2014-10-23 12:20:02 +0200
commitdee2472546a6570f51cea4b0334bbfdcca392498 (patch)
tree1fb68831dc4ae716c6c62b20c157c3fd452b83f4 /jack/tests
parent023ab2c319e1efecfb16061b1e18e72cdbf938fd (diff)
downloadtoolchain_jack-dee2472546a6570f51cea4b0334bbfdcca392498.tar.gz
toolchain_jack-dee2472546a6570f51cea4b0334bbfdcca392498.tar.bz2
toolchain_jack-dee2472546a6570f51cea4b0334bbfdcca392498.zip
Scan JACK-INF folders of input libs for *.jpp
And apply all the preprocessor rules found. Considered input libraries are: - import - classpath This doesen't change the existing properties so you can still add one preprocessor rule using the properties jack.preprocessor and jack.preprocessor.file Change-Id: I125a36a5151e343d77d6fb69ba3b61d29c9501d5
Diffstat (limited to 'jack/tests')
-rw-r--r--jack/tests/com/android/jack/multidex/MultiDexTests.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/jack/tests/com/android/jack/multidex/MultiDexTests.java b/jack/tests/com/android/jack/multidex/MultiDexTests.java
index 895632ea..39a90182 100644
--- a/jack/tests/com/android/jack/multidex/MultiDexTests.java
+++ b/jack/tests/com/android/jack/multidex/MultiDexTests.java
@@ -16,6 +16,8 @@
package com.android.jack.multidex;
+import com.google.common.io.Files;
+
import com.android.jack.Options;
import com.android.jack.TestTools;
import com.android.jack.backend.dex.DexFileWriter;
@@ -238,4 +240,35 @@ public class MultiDexTests {
return;
}
+ @Test
+ public void legacyAppTest002b_auto() throws Exception {
+
+ File testFolder = TestTools.getJackTestsWithJackFolder("multidex/test002");
+ File autoLibrary = prepareLibrary(frameworks);
+ File jackInf = new File(autoLibrary, "JACK-INF");
+ Assert.assertTrue(jackInf.mkdir());
+ Files.copy(new File(testFolder,"config-001.jpp"), new File(jackInf, "config-001.jpp"));
+
+ File out = TestTools.createTempDir("out", "");
+ Options app1Options = new Options();
+ app1Options.addProperty(MultiDexLegacy.MULTIDEX_LEGACY.getName(), "true");
+ app1Options.addProperty(DexFileWriter.DEX_WRITING_POLICY.getName(), "minimal-multidex");
+ app1Options.addJayceImport(autoLibrary);
+
+ TestTools.compileSourceToDex(app1Options, testFolder, TestTools.getDefaultBootclasspathString()
+ + File.pathSeparator + annotations.getPath() + File.pathSeparator + frameworks.getPath(),
+ out, false);
+
+ File outList = getListingOfDex(new File(out, "classes.dex"));
+ // The old toolchain is doing a little better than us here it seems to identify when
+ // InterfaceWithEnum.class instance is used or not.
+ ListingComparator.compare(
+ new File(testFolder,"ref-list-002-1.txt"), outList);
+ File outList2 = getListingOfDex(new File(out, "classes2.dex"));
+ ListingComparator.compare(
+ new File(testFolder,"ref-list-002-2.txt"), outList2);
+ Assert.assertFalse(new File(out, "classes3.dex").exists());
+ return;
+ }
+
}