diff options
author | Sven Gothel <[email protected]> | 2012-03-07 03:58:56 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-07 03:58:56 +0100 |
commit | 238a669b5163e76d79dcf298b3c63381821e01ba (patch) | |
tree | 12c0225a1aae3cac7a161300590bdba9fa58a030 | |
parent | be3c68fada7cf9503f3d501d29283628e0056bcb (diff) |
Don't build and use gluegen.apk (compile time only) ; Don't test classloader -> JarURL on Android
All [remaining] tests passed on Android!
-rw-r--r-- | make/build-test.xml | 2 | ||||
-rw-r--r-- | make/build.xml | 14 | ||||
-rw-r--r-- | make/scripts/adb-uninstall-all.sh | 1 | ||||
-rw-r--r-- | src/junit/com/jogamp/common/util/TestTempJarCache.java | 21 | ||||
-rw-r--r-- | src/junit/com/jogamp/gluegen/test/junit/generation/PCPPTest.java | 16 |
5 files changed, 39 insertions, 15 deletions
diff --git a/make/build-test.xml b/make/build-test.xml index 9f8ef25..e52ad4a 100644 --- a/make/build-test.xml +++ b/make/build-test.xml @@ -86,7 +86,7 @@ </path> <property name="junit.run.jars" value="${junit.jar}${path.separator}${ant.jar}${path.separator}${TestJarsInJar.jar}${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/> <property name="junit.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${gluegen.root}/make/lib/TestJarsInJar.jar${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/> - <property name="junit.run.remote.apks" value="${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen.apk${path.separator}${build_t}/gluegen-test.apk${path.separator}${gluegen.root}/make/lib/TestJarsInJar.apk"/> + <property name="junit.run.remote.apks" value="${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen-rt.apk${path.separator}${build_t}/gluegen-test.apk${path.separator}${gluegen.root}/make/lib/TestJarsInJar.apk"/> <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet --> diff --git a/make/build.xml b/make/build.xml index 484dae4..eb34305 100644 --- a/make/build.xml +++ b/make/build.xml @@ -729,11 +729,10 @@ <target name="gluegen.build.check.aapt" depends="init"> <uptodate property="gluegen.build.skip.aapt"> - <srcfiles dir= "." includes="*.xml"/> - <srcfiles dir= "${src.java}" includes="**"/> - <srcfiles dir= "${c.grammar}" includes="**/*.g"/> - <srcfiles dir= "${j.grammar}" includes="**/*.g"/> - <mapper type="merge" to="${build}/gluegen.apk"/> + <srcfiles dir= "." includes="*.xml"/> + <srcfiles dir= "${src.java}" includes="**"/> + <srcfiles dir= "${src.generated}" includes="**"/> + <mapper type="merge" to="${build}/gluegen-rt.apk"/> </uptodate> </target> @@ -752,7 +751,8 @@ version.name="${gluegen.version.plus}" /> - <aapt.signed + <!-- No need for a GlueGen Compile Time library on Android --> + <!-- aapt.signed jarbuilddir="${build}" jarbasename="gluegen" nativebuilddir="${gluegen.lib.dir}" @@ -763,7 +763,7 @@ jarmanifest.path="${build}/Manifest.temp" version.code="${gluegen_int_version}" version.name="${gluegen.version.plus}" - /> + /--> </target> diff --git a/make/scripts/adb-uninstall-all.sh b/make/scripts/adb-uninstall-all.sh new file mode 100644 index 0000000..9973ef4 --- /dev/null +++ b/make/scripts/adb-uninstall-all.sh @@ -0,0 +1 @@ +adb uninstall com.jogamp.common diff --git a/src/junit/com/jogamp/common/util/TestTempJarCache.java b/src/junit/com/jogamp/common/util/TestTempJarCache.java index 58e44c5..d97894c 100644 --- a/src/junit/com/jogamp/common/util/TestTempJarCache.java +++ b/src/junit/com/jogamp/common/util/TestTempJarCache.java @@ -42,6 +42,7 @@ import org.junit.Test; import com.jogamp.common.GlueGenVersion; import com.jogamp.common.jvm.JNILibLoaderBase; +import com.jogamp.common.os.AndroidVersion; import com.jogamp.common.os.NativeLibrary; import com.jogamp.common.os.Platform; import com.jogamp.common.util.cache.TempCacheReg; @@ -137,6 +138,7 @@ public class TestTempJarCache extends JunitTracer { @Test public void testJarUtil01a() throws IOException { + if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; } JarFile jarFile = JarUtil.getJarFile(GlueGenVersion.class.getName(), this.getClass().getClassLoader()); Assert.assertNotNull(jarFile); JarUtil.extract(fileCache.getTempDir(), null, jarFile, false, true, true); @@ -147,7 +149,8 @@ public class TestTempJarCache extends JunitTracer { } @Test - public void testJarUtil01b() throws IOException { + public void testJarUtil01b() throws IOException { + if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; } File f = new File(fileCache.getTempDir(), "META-INF/MANIFEST.MF"); Assert.assertTrue(f.exists()); f = new File(fileCache.getTempDir(), IOUtil.getClassFileName(GlueGenVersion.class.getName())); @@ -155,13 +158,18 @@ public class TestTempJarCache extends JunitTracer { } @Test - public void testTempJarCache01LoadAllTestManifestAndClass() throws IOException { + public void testTempJarCache00Init() throws IOException { // may already been initialized by other test // Assert.assertFalse(TempCacheReg.isTempJarCacheUsed()); // Assert.assertFalse(TempJarCache.isInitialized()); Assert.assertTrue(TempJarCache.initSingleton()); Assert.assertTrue(TempCacheReg.isTempJarCacheUsed()); - Assert.assertTrue(TempJarCache.isInitialized()); + Assert.assertTrue(TempJarCache.isInitialized()); + } + + @Test + public void testTempJarCache01LoadAllTestManifestAndClass() throws IOException { + if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; } final ClassLoader cl = getClass().getClassLoader(); TempJarCache.addAll(GlueGenVersion.class, JarUtil.getJarFileURL(GlueGenVersion.class.getName(), cl), cl); @@ -183,6 +191,7 @@ public class TestTempJarCache extends JunitTracer { @Test public void testTempJarCache02AddNativeLibs() throws IOException { + if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; } final String nativeJarName = "gluegen-rt-natives-"+Platform.getOSAndArch()+".jar"; final String libBaseName = "gluegen-rt"; final ClassLoader cl = getClass().getClassLoader(); @@ -202,6 +211,7 @@ public class TestTempJarCache extends JunitTracer { @Test public void testTempJarCache03AddNativeJarLibs() throws IOException { + if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; } final String libBaseName = "gluegen-rt"; JNILibLoaderBase.addNativeJarLibs(TempJarCache.class, libBaseName); @@ -215,7 +225,7 @@ public class TestTempJarCache extends JunitTracer { } @Test - public void testTempJarCache04aSameClassLoader() throws IOException { + public void testTempJarCache04aSameClassLoader() throws IOException { assertTempFileCachesIndividualInstances(true, TempJarCache.getTempFileCache(), TempJarCache.getTempFileCache()); ClassLoader cl = getClass().getClassLoader(); @@ -226,9 +236,10 @@ public class TestTempJarCache extends JunitTracer { @Test public void testTempJarCache04bDiffClassLoader() throws IOException { + if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; } URL[] urls = new URL[] { JarUtil.getJarFileURL(TempJarCache.class.getName(), getClass().getClassLoader()) }; System.err.println("url: "+urls[0]); - ClassLoader cl2 = new TestClassLoader(urls, null); + ClassLoader cl2 = new TestClassLoader(urls, null); ClassLoader cl3 = new TestClassLoader(urls, null); Assert.assertFalse(( (Boolean) ReflectionUtil.callStaticMethod(TempJarCache.class.getName(), "isInitialized", null, null, cl2) diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/PCPPTest.java b/src/junit/com/jogamp/gluegen/test/junit/generation/PCPPTest.java index c4c7e56..4c47a78 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/PCPPTest.java +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/PCPPTest.java @@ -28,13 +28,18 @@ package com.jogamp.gluegen.test.junit.generation; +import com.jogamp.common.os.AndroidVersion; import com.jogamp.gluegen.pcpp.PCPP; +import com.jogamp.junit.util.JunitTracer; + import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Collections; + +import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; @@ -42,11 +47,18 @@ import static org.junit.Assert.*; * serves mainly as entry point for debugging purposes. * @author Sven Gothel, Michael Bien */ -public class PCPPTest { +public class PCPPTest extends JunitTracer { + @BeforeClass + public static void init() { + if(AndroidVersion.isAvailable) { + // PCPP is n/a on Android - GlueGen Runtime only + setTestSupported(false); + } + } + @Test public void pcppMacroDefinitionTest() throws FileNotFoundException, IOException { - PCPP pp = new PCPP(Collections.<String>emptyList(), false, false); ByteArrayOutputStream output = new ByteArrayOutputStream(); pp.setOut(output); |