summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-02-28 21:55:02 +0100
committerSven Gothel <[email protected]>2013-02-28 21:55:02 +0100
commit692ee1477a5422cb119070ecd87321833c302873 (patch)
treef1d1883d099f2e9ed8719f3fab2eb257dc602c08
parent99a50b38f5650fedca0f207e03706ffa9492e50c (diff)
Unit Tests: OSX/Java7 w/o 32bit tests ; Reliable Test1p*JavaEmitter JNI binding initialization
- OSX/Java7 w/o 32bit tests OSX/Java7 has no 32bit JVM, disable d32 tests for such, using property 'use.macosx32' - Reliable Test1p*JavaEmitter JNI binding initialization Load libs and init JNI binding statically w/ @BeforeClass, since OSX/Java7 for some reason gets confused (?) w/ init sequence. This is no issue for JOGL etc .. as far we have observed.
-rw-r--r--make/build-test.xml7
-rwxr-xr-xmake/scripts/runtest.sh4
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/Test1p1JavaEmitter.java7
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java12
4 files changed, 16 insertions, 14 deletions
diff --git a/make/build-test.xml b/make/build-test.xml
index 7f2c521..8a11a17 100644
--- a/make/build-test.xml
+++ b/make/build-test.xml
@@ -384,8 +384,9 @@ chmod 644 ${results}/* \${line.separator}
<jvmarg value="-Dgluegen.root=${gluegen.root}"/>
<jvmarg value="-Drootrel.build=${rootrel.build}"/>
<!--
- <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
- <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
+ <jvmarg value="-Djogamp.debug.NativeLibrary=true"/>
+ <jvmarg value="-Djogamp.debug.ProcAddressHelper=true"/>
+ <jvmarg value="-Djogamp.debug.JNILibLoader=true"/>
<jvmarg value="-verbose:jni"/>
<jvmarg value="-client"/>
-->
@@ -417,7 +418,7 @@ chmod 644 ${results}/* \${line.separator}
<mkdir dir="${build}/test/results"/>
</target>
- <target name="junit.run.local.osx.d32" if="isOSX">
+ <target name="junit.run.local.osx.d32" if="use.macosx32">
<var name="jvmDataModel.arg" unset="true"/>
<var name="jvmDataModel.arg" value="-d32"/>
diff --git a/make/scripts/runtest.sh b/make/scripts/runtest.sh
index 3eaec4b..f8615a5 100755
--- a/make/scripts/runtest.sh
+++ b/make/scripts/runtest.sh
@@ -93,8 +93,8 @@ function onetest() {
#onetest com.jogamp.gluegen.PCPPTest 2>&1 | tee -a $LOG
#onetest com.jogamp.common.nio.TestPointerBufferEndian 2>&1 | tee -a $LOG
#onetest com.jogamp.common.nio.TestStructAccessorEndian 2>&1 | tee -a $LOG
-onetest com.jogamp.common.os.TestElfReader01 2>&1 | tee -a $LOG
-#onetest com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter 2>&1 | tee -a $LOG
+#onetest com.jogamp.common.os.TestElfReader01 2>&1 | tee -a $LOG
+onetest com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter 2>&1 | tee -a $LOG
#onetest com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.TestPlatform01 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.TestRunnableTask01 2>&1 | tee -a $LOG
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p1JavaEmitter.java b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p1JavaEmitter.java
index 35907de..60159be 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p1JavaEmitter.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p1JavaEmitter.java
@@ -31,9 +31,8 @@ package com.jogamp.gluegen.test.junit.generation;
import java.io.IOException;
import com.jogamp.gluegen.test.junit.generation.impl.Bindingtest1p1Impl;
-import com.jogamp.gluegen.test.junit.generation.impl.Bindingtest1p2Impl;
-
+import org.junit.BeforeClass;
import org.junit.Test;
@@ -46,8 +45,8 @@ public class Test1p1JavaEmitter extends BaseClass {
/**
* Verifies loading of the new library.
*/
- @Test
- public void chapter01TestLoadLibrary() throws Exception {
+ @BeforeClass
+ public static void chapter01TestLoadLibrary() throws Exception {
BindingJNILibLoader.loadBindingtest1p1();
}
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java
index 3438c3d..64f17a5 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java
@@ -34,7 +34,9 @@ import com.jogamp.gluegen.test.junit.generation.impl.Bindingtest1p2Impl;
import com.jogamp.common.os.NativeLibrary;
+import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -48,10 +50,10 @@ public class Test1p2ProcAddressEmitter extends BaseClass {
/**
* Verifies loading of the new library.
*/
- @Test
- public void chapter01TestLoadLibrary() throws Exception {
+ @BeforeClass
+ public static void chapter01TestLoadLibrary() throws Exception {
BindingJNILibLoader.loadBindingtest1p2();
- dynamicLookupHelper = NativeLibrary.open("test1", getClass().getClassLoader(), true);
+ dynamicLookupHelper = NativeLibrary.open("test1", Test1p2ProcAddressEmitter.class.getClassLoader(), true);
Assert.assertNotNull("NativeLibrary.open(test1) failed", dynamicLookupHelper);
Bindingtest1p2Impl.resetProcAddressTable(dynamicLookupHelper);
@@ -122,8 +124,8 @@ public class Test1p2ProcAddressEmitter extends BaseClass {
/**
* Verifies unloading of the new library.
*/
- @Test
- public void chapter0XTestUnloadLibrary() throws Exception {
+ @AfterClass
+ public static void chapter0XTestUnloadLibrary() throws Exception {
Assert.assertNotNull(dynamicLookupHelper);
dynamicLookupHelper.close();
dynamicLookupHelper = null;