diff options
author | mikaelpeltier <mikaelpeltier@google.com> | 2014-12-24 08:46:11 +0100 |
---|---|---|
committer | mikaelpeltier <mikaelpeltier@google.com> | 2014-12-24 09:08:00 +0100 |
commit | aab73f54dedaef4cc57fc343adc429d9325bc095 (patch) | |
tree | 6365ebaedb66e00f02470caad0aef6f4918aa772 /jack/tests | |
parent | 77c0ee2e741020e10b165e3a7f7e7fc3dde22b90 (diff) | |
download | toolchain_jack-aab73f54dedaef4cc57fc343adc429d9325bc095.tar.gz toolchain_jack-aab73f54dedaef4cc57fc343adc429d9325bc095.tar.bz2 toolchain_jack-aab73f54dedaef4cc57fc343adc429d9325bc095.zip |
Remove bootclasspath
Change-Id: Id880b0909a843feb719e75723c70330f771c10ae
Diffstat (limited to 'jack/tests')
7 files changed, 51 insertions, 111 deletions
diff --git a/jack/tests/com/android/jack/TestTools.java b/jack/tests/com/android/jack/TestTools.java index 3b627748..75ec8e60 100644 --- a/jack/tests/com/android/jack/TestTools.java +++ b/jack/tests/com/android/jack/TestTools.java @@ -344,13 +344,13 @@ public class TestTools { @Nonnull - public static File[] getDefaultBootclasspath() { + public static File[] getDefaultClasspath() { return new File[] {getFromAndroidTree( "toolchain/jack/jack/libs/core-stubs-mini.jack")}; } @Nonnull - public static String getDefaultBootclasspathString() { + public static String getDefaultClasspathString() { return getFromAndroidTree( "toolchain/jack/jack/libs/core-stubs-mini.jack") .getAbsolutePath(); @@ -430,8 +430,7 @@ public class TestTools { @Nonnull public static Options buildCommandLineArgs(@Nonnull File fileOrSourcelist, @CheckForNull File jarjarRules) throws IOException { - Options options = buildCommandLineArgs(null /* bootclasspath */, null /* classpath */, - new File[]{fileOrSourcelist}); + Options options = buildCommandLineArgs(null /* classpath */, new File[] {fileOrSourcelist}); options.jarjarRulesFile = jarjarRules; return options; @@ -440,56 +439,29 @@ public class TestTools { @Nonnull public static Options buildCommandLineArgs(@Nonnull File[] filesOrSourcelists) throws IOException { - return buildCommandLineArgs(null /* bootclasspath */, null /* classpath */, filesOrSourcelists); + return buildCommandLineArgs(null /* classpath */, filesOrSourcelists); } @Nonnull - public static Options buildCommandLineArgs( - @CheckForNull File[] bootclasspath, @CheckForNull File[] classpath, - @Nonnull File fileOrSourceList, @CheckForNull ProguardFlags[] proguardFlagsFiles, - boolean runDxOptimizations, boolean emitDebugInfo) throws IOException { - Options options = buildCommandLineArgs(bootclasspath, classpath, fileOrSourceList); - options.proguardFlagsFiles = new ArrayList<File>(); - options.emitLocalDebugInfo = emitDebugInfo; - if (runDxOptimizations) { - options.enableDxOptimizations(); - } else { - options.disableDxOptimizations(); - } - if (proguardFlagsFiles != null) { - for (ProguardFlags proguardFlagsFile : proguardFlagsFiles) { - options.proguardFlagsFiles.add(proguardFlagsFile); - } - } - options.setOutputDir(TestTools.createTempDir("test", "dex")); - return options; + public static Options buildCommandLineArgs(@CheckForNull File[] classpath, + @Nonnull File fileOrSourcelist) throws IOException { + return buildCommandLineArgs(classpath, new File[] {fileOrSourcelist}); } @Nonnull - public static Options buildCommandLineArgs(@CheckForNull File[] bootclasspath, - @CheckForNull File[] classpath, @Nonnull File fileOrSourcelist) throws IOException { - return buildCommandLineArgs(bootclasspath, classpath, new File[]{fileOrSourcelist}); - } - @Nonnull - public static Options buildCommandLineArgs(@CheckForNull File[] bootclasspath, - @CheckForNull File[] classpath, @Nonnull File[] filesOrSourcelists) throws IOException { + public static Options buildCommandLineArgs(@CheckForNull File[] classpath, + @Nonnull File[] filesOrSourcelists) throws IOException { Options options = new Options(); - if (bootclasspath == null) { - bootclasspath = getDefaultBootclasspath(); - } - if (bootclasspath.length != 0) { - String bootclasspathStr = getClasspathAsString(bootclasspath); - assert bootclasspathStr != null; - options.bootclasspath = bootclasspathStr; - } + String classpathStr = getDefaultClasspathString(); + classpathStr += File.pathSeparatorChar; if (classpath != null && classpath.length != 0) { - String classpathStr = getClasspathAsString(classpath); - assert classpathStr != null; - options.classpath = classpathStr; + classpathStr += getClasspathAsString(classpath); } + options.classpath = classpathStr; + List<String> ecjArgs = buildEcjArgs(); for (File file : filesOrSourcelists) { addFile(file, ecjArgs); @@ -579,11 +551,11 @@ public class TestTools { return (session); } - public static void checkStructure(@CheckForNull File[] bootclasspath, + public static void checkStructure( @CheckForNull File[] classpath, @Nonnull File fileOrSourceList, boolean withDebugInfo) throws Exception { - checkStructure(bootclasspath, + checkStructure( classpath, fileOrSourceList, withDebugInfo, @@ -593,13 +565,13 @@ public class TestTools { (ProguardFlags[]) null); } - public static void checkStructure(@CheckForNull File[] bootclasspath, + public static void checkStructure( @CheckForNull File[] classpath, @Nonnull File fileOrSourceList, boolean withDebugInfo, boolean compareInstructionNumber, float instructionNumberTolerance) throws Exception { - checkStructure(bootclasspath, + checkStructure( classpath, fileOrSourceList, withDebugInfo, @@ -609,12 +581,12 @@ public class TestTools { (ProguardFlags[]) null); } - public static void checkStructure(@CheckForNull File[] bootclasspath, + public static void checkStructure( @CheckForNull File[] classpath, @Nonnull File fileOrSourceList, boolean withDebugInfo, @CheckForNull ProguardFlags[] proguardFlagFiles) throws Exception { - checkStructure(bootclasspath, + checkStructure( classpath, fileOrSourceList, withDebugInfo, @@ -624,7 +596,7 @@ public class TestTools { proguardFlagFiles); } - public static void checkStructure(@CheckForNull File[] bootclasspath, + public static void checkStructure( @CheckForNull File[] classpath, @Nonnull File fileOrSourceList, boolean withDebugInfo, @@ -633,9 +605,7 @@ public class TestTools { @CheckForNull JarJarRules jarjarRules, @CheckForNull ProguardFlags[] proguardFlagFiles) throws Exception { checkStructure(new Options(), - bootclasspath, classpath, - /* refBootclasspath = */ null, /* refClasspath = */ null, fileOrSourceList, withDebugInfo, @@ -646,9 +616,7 @@ public class TestTools { } public static void checkStructure(@Nonnull Options options, - @CheckForNull File[] bootclasspath, @CheckForNull File[] classpath, - @CheckForNull File[] refBootclasspath, @CheckForNull File[] refClasspath, @Nonnull File fileOrSourceList, boolean withDebugInfo, @@ -659,7 +627,7 @@ public class TestTools { boolean runDxOptimizations = !withDebugInfo; boolean useEcjAsRefCompiler = withDebugInfo; - String classpathStr = getClasspathsAsString(bootclasspath, classpath); + String classpathStr = getClasspathsAsString(getDefaultClasspath(), classpath); File jackDexFolder = TestTools.createTempDir("jack", "dex"); @@ -678,7 +646,7 @@ public class TestTools { proguardFlagFiles, withDebugInfo); - Options refOptions = buildCommandLineArgs(refBootclasspath, refClasspath, fileOrSourceList); + Options refOptions = buildCommandLineArgs(refClasspath, fileOrSourceList); TestTools.compareDexToReference(jackDexFolder, refOptions, @@ -962,7 +930,7 @@ public class TestTools { @Nonnull File inJar, @Nonnull File outJar, @CheckForNull File[] bootclasspath) { String bootclasspathStr = null; if (bootclasspath == null) { - bootclasspathStr = getDefaultBootclasspathString(); + bootclasspathStr = getDefaultClasspathString(); } else { bootclasspathStr = getClasspathAsString(bootclasspath); } @@ -1025,12 +993,6 @@ public class TestTools { // TODO(jmhenaff): This hack will be removed as soon as TestTools will be removed arguments.add(compilerArgs.classpath.replace("core-stubs-mini.jack", "core-stubs-mini.jar")); } - - if (compilerArgs.bootclasspath != null) { - arguments.add("-bootclasspath"); - // TODO(jmhenaff): This hack will be removed as soon as TestTools will be removed - arguments.add(compilerArgs.bootclasspath.replace("core-stubs-mini.jack", "core-stubs-mini.jar")); - } return arguments; } diff --git a/jack/tests/com/android/jack/WithPhantomTest.java b/jack/tests/com/android/jack/WithPhantomTest.java index 1c196569..3043f3bc 100644 --- a/jack/tests/com/android/jack/WithPhantomTest.java +++ b/jack/tests/com/android/jack/WithPhantomTest.java @@ -36,7 +36,7 @@ import javax.annotation.Nonnull; public class WithPhantomTest { @Nonnull - private static final String BOOTCLASSPATH = TestTools.getDefaultBootclasspathString(); + private static final String CLASSPATH = TestTools.getDefaultClasspathString(); @Nonnull private static final String TEST001 = "withphantom/test001"; @Nonnull @@ -52,7 +52,7 @@ public class WithPhantomTest { File tempJackFolder = TestTools.createTempDir("jack", "dir"); TestTools.compileSourceToJack(new Options(), TestTools.getJackTestsWithJackFolder(TEST001), - BOOTCLASSPATH, tempJackFolder, false /* non-zipped */); + CLASSPATH, tempJackFolder, false /* non-zipped */); boolean deleted = new File(tempJackFolder, FileType.JAYCE.getPrefix() + File.separatorChar + fixPath("com/android/jack/withphantom/test001/jack/A.jayce")).delete(); @@ -63,7 +63,7 @@ public class WithPhantomTest { File tempOut1 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut1, Lists.create( new ProguardFlags(testFolder, "shrink1.flags")), @@ -72,7 +72,7 @@ public class WithPhantomTest { File tempOut2 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut2, Lists.create( new ProguardFlags(testFolder, "shrink2.flags")), @@ -81,7 +81,7 @@ public class WithPhantomTest { File tempOut3 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut3, Lists.create( new ProguardFlags(testFolder, "obf1.flags")), @@ -90,7 +90,7 @@ public class WithPhantomTest { File tempOut4 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut4, Lists.create( new ProguardFlags(testFolder, "obf2.flags")), @@ -106,7 +106,7 @@ public class WithPhantomTest { File tempJackFolder = TestTools.createTempDir("jack", "dir"); TestTools.compileSourceToJack(new Options(), TestTools.getJackTestsWithJackFolder(TEST001), - BOOTCLASSPATH, tempJackFolder, false /* non-zipped */); + CLASSPATH, tempJackFolder, false /* non-zipped */); boolean deleted = new File(tempJackFolder, fixPath(FileType.JAYCE.getPrefix() + File.separatorChar + "com/android/jack/withphantom/test001/jack/A$Inner1.jayce")).delete(); @@ -121,7 +121,7 @@ public class WithPhantomTest { File tempOut1 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut1, Lists.create( new ProguardFlags(testFolder, "shrink1.flags")), @@ -130,7 +130,7 @@ public class WithPhantomTest { File tempOut2 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut2, Lists.create( new ProguardFlags(testFolder, "shrink2.flags")), @@ -139,7 +139,7 @@ public class WithPhantomTest { File tempOut3 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut3, Lists.create( new ProguardFlags(testFolder, "obf1.flags")), @@ -148,7 +148,7 @@ public class WithPhantomTest { File tempOut4 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut4, Lists.create( new ProguardFlags(testFolder, "obf2.flags")), @@ -165,7 +165,7 @@ public class WithPhantomTest { File tempJackFolder = TestTools.createTempDir("jack", "dir"); TestTools.compileSourceToJack(new Options(), TestTools.getJackTestsWithJackFolder(TEST002), - BOOTCLASSPATH, tempJackFolder, false /* non-zipped */); + CLASSPATH, tempJackFolder, false /* non-zipped */); File[] inners = new File(tempJackFolder, fixPath(FileType.JAYCE.getPrefix() + File.separatorChar + "com/android/jack/withphantom/test002/jack/")).listFiles(new FilenameFilter() { @@ -183,7 +183,7 @@ public class WithPhantomTest { File tempOut1 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut1, Lists.create( new ProguardFlags(testFolder, "obf1.flags")), @@ -199,7 +199,7 @@ public class WithPhantomTest { File tempJackFolder = TestTools.createTempDir("jack", "dir"); TestTools.compileSourceToJack(new Options(), TestTools.getJackTestsWithJackFolder(TEST002), - BOOTCLASSPATH, tempJackFolder, false /* non-zipped */); + CLASSPATH, tempJackFolder, false /* non-zipped */); boolean deleted = new File(tempJackFolder, fixPath(FileType.JAYCE.getPrefix() + File.separatorChar + "com/android/jack/withphantom/test002/jack/A.jayce")).delete(); @@ -210,7 +210,7 @@ public class WithPhantomTest { File tempOut1 = TestTools.createTempDir("jack", "dir"); TestTools.shrobJackToJack(new Options(), tempJackFolder, - BOOTCLASSPATH, + CLASSPATH, tempOut1, Lists.create( new ProguardFlags(testFolder, "obf1.flags")), diff --git a/jack/tests/com/android/jack/compile/androidtree/bouncycastle/BouncycastleCompilationTest.java b/jack/tests/com/android/jack/compile/androidtree/bouncycastle/BouncycastleCompilationTest.java index 90d1b43f..e098477c 100644 --- a/jack/tests/com/android/jack/compile/androidtree/bouncycastle/BouncycastleCompilationTest.java +++ b/jack/tests/com/android/jack/compile/androidtree/bouncycastle/BouncycastleCompilationTest.java @@ -33,8 +33,7 @@ import java.io.File; @Ignore("Tree") public class BouncycastleCompilationTest { - private static File[] BOOTCLASSPATH; - private static File[] REF_BOOTCLASSPATH; + private static File[] CLASSPATH; private static File SOURCELIST; @@ -43,14 +42,10 @@ public class BouncycastleCompilationTest { @BeforeClass public static void setUpClass() { BouncycastleCompilationTest.class.getClassLoader().setDefaultAssertionStatus(true); - BOOTCLASSPATH = new File[] { + CLASSPATH = new File[] { TestTools.getFromAndroidTree( "out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.zip") }; - REF_BOOTCLASSPATH = new File[] { - TestTools.getFromAndroidTree( - "out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar") - }; SOURCELIST = TestTools.getTargetLibSourcelist("bouncycastle"); JARJAR_RULES = new JarJarRules( TestTools.getFromAndroidTree("external/bouncycastle/jarjar-rules.txt")); @@ -64,7 +59,7 @@ public class BouncycastleCompilationTest { options.disableDxOptimizations(); TestTools.compileSourceToDex(options, SOURCELIST, - TestTools.getClasspathAsString(BOOTCLASSPATH), + TestTools.getClasspathAsString(CLASSPATH), outDexFolder, false /* zip */, JARJAR_RULES, @@ -77,9 +72,7 @@ public class BouncycastleCompilationTest { public void compareBouncycastleStructure() throws Exception { TestTools.checkStructure( new Options(), - BOOTCLASSPATH, /* classpath = */ null, - REF_BOOTCLASSPATH, /* refClasspath = */ null, SOURCELIST, /* compareDebugInfoBinary = */ false, diff --git a/jack/tests/com/android/jack/compile/androidtree/core/CoreCompilationTest.java b/jack/tests/com/android/jack/compile/androidtree/core/CoreCompilationTest.java index 91755f0b..1341c435 100644 --- a/jack/tests/com/android/jack/compile/androidtree/core/CoreCompilationTest.java +++ b/jack/tests/com/android/jack/compile/androidtree/core/CoreCompilationTest.java @@ -60,9 +60,7 @@ public class CoreCompilationTest { Options options = new Options(); options.addProperty(Options.JAVA_SOURCE_VERSION.getName(), JavaVersion.JAVA_7.toString()); TestTools.checkStructure(options, - /* bootclasspath = */ null, /* classpath = */ null, - /* refBootclasspath = */ null, /* refClasspath = */ null, SOURCELIST, /* withDebugInfo = */ false, diff --git a/jack/tests/com/android/jack/compile/androidtree/ext/ExtCompilationTest.java b/jack/tests/com/android/jack/compile/androidtree/ext/ExtCompilationTest.java index 559b1dbf..9248a5a5 100644 --- a/jack/tests/com/android/jack/compile/androidtree/ext/ExtCompilationTest.java +++ b/jack/tests/com/android/jack/compile/androidtree/ext/ExtCompilationTest.java @@ -33,22 +33,17 @@ import java.io.File; @Ignore("Tree") public class ExtCompilationTest { - private static File[] BOOTCLASSPATH; - private static File[] REF_BOOTCLASSPATH; + private static File[] CLASSPATH; private static File SOURCELIST; @BeforeClass public static void setUpClass() { ExtCompilationTest.class.getClassLoader().setDefaultAssertionStatus(true); - BOOTCLASSPATH = new File[] { + CLASSPATH = new File[] { TestTools.getFromAndroidTree( "out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.zip") }; - REF_BOOTCLASSPATH = new File[] { - TestTools.getFromAndroidTree( - "out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar") - }; SOURCELIST = TestTools.getTargetLibSourcelist("ext"); } @@ -57,16 +52,14 @@ public class ExtCompilationTest { public void compileExt() throws Exception { File outDexFolder = TestTools.createTempDir("ext", ".dex"); TestTools.compileSourceToDex(new Options(), SOURCELIST, - TestTools.getClasspathAsString(BOOTCLASSPATH), outDexFolder, false); + TestTools.getClasspathAsString(CLASSPATH), outDexFolder, false); } @Test @Category(SlowTests.class) public void compareExtStructure() throws Exception { TestTools.checkStructure(new Options(), - BOOTCLASSPATH, /* classpath = */ null, - REF_BOOTCLASSPATH, /* refClasspath = */ null, SOURCELIST, /* compareDebugInfoBinary = */ false, diff --git a/jack/tests/com/android/jack/library/LibraryTest.java b/jack/tests/com/android/jack/library/LibraryTest.java index ea23ab0f..21b58363 100644 --- a/jack/tests/com/android/jack/library/LibraryTest.java +++ b/jack/tests/com/android/jack/library/LibraryTest.java @@ -47,7 +47,7 @@ public class LibraryTest { TestTools.compileSourceToDex(new Options(), TestTools.getJackTestsWithJackFolder("library/test001"), - TestTools.getDefaultBootclasspathString() + File.pathSeparator + emptyLib.getPath(), + TestTools.getDefaultClasspathString() + File.pathSeparator + emptyLib.getPath(), TestTools.createTempFile("library001", ".zip"), /* zip = */ true); } @@ -57,7 +57,7 @@ public class LibraryTest { TestTools.compileSourceToDex(new Options(), TestTools.getJackTestsWithJackFolder("library/test001"), - TestTools.getDefaultBootclasspathString() + File.pathSeparator + emptyLib.getPath(), + TestTools.getDefaultClasspathString() + File.pathSeparator + emptyLib.getPath(), TestTools.createTempFile("library001", ".zip"), /* zip = */ true); } @@ -68,7 +68,7 @@ public class LibraryTest { options.addJayceImport(lib); TestTools.compileSourceToDex(options, TestTools.getJackTestsWithJackFolder("library/test001"), - TestTools.getDefaultBootclasspathString(), + TestTools.getDefaultClasspathString(), TestTools.createTempFile("library001", ".zip"), /* zip = */ true); } @@ -80,7 +80,7 @@ public class LibraryTest { File out = TestTools.createTempFile("library001", ".jack"); TestTools.compileSourceToJack(options, TestTools.getJackTestsWithJackFolder("library/test001"), - TestTools.getDefaultBootclasspathString(), + TestTools.getDefaultClasspathString(), out, /* zip = */ true); RunnableHooks hooks = new RunnableHooks(); diff --git a/jack/tests/com/android/jack/statistics/BlockStatisticsOnCore.java b/jack/tests/com/android/jack/statistics/BlockStatisticsOnCore.java index 6778d16b..15a4abda 100644 --- a/jack/tests/com/android/jack/statistics/BlockStatisticsOnCore.java +++ b/jack/tests/com/android/jack/statistics/BlockStatisticsOnCore.java @@ -37,26 +37,20 @@ import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; -import java.io.File; - import javax.annotation.Nonnull; @Ignore("Tree") public class BlockStatisticsOnCore { - private static File[] BOOTCLASSPATH; - @BeforeClass public static void setUpClass() { BlockStatisticsOnCore.class.getClassLoader().setDefaultAssertionStatus(true); - BOOTCLASSPATH = new File[] {TestTools.getFromAndroidTree( - "out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar")}; } @Test public void computeBlockStatOnCore() throws Exception { - Options compilerArgs = TestTools.buildCommandLineArgs(BOOTCLASSPATH, null, - TestTools.getFromAndroidTree("libcore/luni/src/main/java/")); + Options compilerArgs = + TestTools.buildCommandLineArgs(TestTools.getFromAndroidTree("libcore/luni/src/main/java/")); compilerArgs.addProperty(Options.METHOD_FILTER.getName(), "supported-methods"); JSession session = buildSession(compilerArgs); Assert.assertNotNull(session); |