From db5bdd94d004038146a0f9f09caf2e0f1866d67a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 9 May 2014 09:41:57 +0200 Subject: build/test: Add ant-junit4.jar to classpath; Add experimental gluegen-rt-alt recipe (inactive); Misc .. --- make/Manifest-rt-alt | 19 ++++++ make/build-test.xml | 2 +- make/build.xml | 27 ++++++++ make/gluegen-properties.xml | 1 + make/scripts/make.gluegen.all.generic.sh | 26 ++++++++ make/scripts/runtest.sh | 31 ++++----- .../junit/generation/Test1p2LoadJNIAndImplLib.java | 77 ++++++++++++++++++++++ 7 files changed, 167 insertions(+), 16 deletions(-) create mode 100755 make/Manifest-rt-alt create mode 100755 make/scripts/make.gluegen.all.generic.sh create mode 100644 src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2LoadJNIAndImplLib.java diff --git a/make/Manifest-rt-alt b/make/Manifest-rt-alt new file mode 100755 index 0000000..d95830e --- /dev/null +++ b/make/Manifest-rt-alt @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Application-Name: GlueGen Run-Time +Specification-Title: GlueGen Java Bindings Generator +Specification-Version: @BASEVERSION@ +Specification-Vendor: JogAmp Community +Implementation-Title: GlueGen Run-Time +Implementation-Version: @VERSION@ +Implementation-Build: @BUILD_VERSION@ +Implementation-Branch: @SCM_BRANCH@ +Implementation-Commit: @SCM_COMMIT@ +Implementation-Vendor: JogAmp Community +Implementation-Vendor-Id: com.jogamp +Implementation-URL: http://jogamp.org/ +Extension-Name: com.jogamp.common +Trusted-Library: true +Permissions: all-permissions +Application-Library-Allowable-Codebase: * +@JAR_CODEBASE_TAG@ + diff --git a/make/build-test.xml b/make/build-test.xml index 932d964..2305fe9 100644 --- a/make/build-test.xml +++ b/make/build-test.xml @@ -86,7 +86,7 @@ - + diff --git a/make/build.xml b/make/build.xml index d835f8b..8791d76 100644 --- a/make/build.xml +++ b/make/build.xml @@ -778,6 +778,19 @@ + + @@ -805,6 +818,20 @@ + + + diff --git a/make/scripts/make.gluegen.all.generic.sh b/make/scripts/make.gluegen.all.generic.sh new file mode 100755 index 0000000..d212a8b --- /dev/null +++ b/make/scripts/make.gluegen.all.generic.sh @@ -0,0 +1,26 @@ +#! /bin/sh + +# -Dc.compiler.debug=true +# -Dgluegen.cpptasks.detected.os=true \ +# -DisUnix=true \ +# -DisLinux=true \ +# -DisLinuxAMD64=true \ +# -DisX11=true \ +# +# -Dtarget.sourcelevel=1.6 \ +# -Dtarget.targetlevel=1.6 \ +# -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \ +# +# -Dc.compiler.debug=true \ +# -Djavacdebuglevel="source,lines,vars" \ + +export SOURCE_LEVEL=1.6 +export TARGET_LEVEL=1.6 +export TARGET_RT_JAR=/opt-share/jre1.6.0_30/lib/rt.jar + +#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org" +export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet" + +# BUILD_ARCHIVE=true \ +ant \ + $* 2>&1 | tee make.gluegen.all.generic.log diff --git a/make/scripts/runtest.sh b/make/scripts/runtest.sh index 62376d1..947755f 100755 --- a/make/scripts/runtest.sh +++ b/make/scripts/runtest.sh @@ -57,22 +57,22 @@ rm -f $LOG #D_ARGS="-Djogamp.debug=all" function onetest() { - CLASSPATH=lib/junit.jar:$ANT_JARS:"$builddir"/../make/lib/TestJarsInJar.jar:"$builddir"/gluegen-rt.jar:"$builddir"/gluegen.jar:"$builddir"/test/build/gluegen-test.jar + USE_CLASSPATH=lib/junit.jar:$ANT_JARS:"$builddir"/../make/lib/TestJarsInJar.jar:"$builddir"/gluegen-rt.jar:"$builddir"/gluegen.jar:"$builddir"/test/build/gluegen-test.jar + #USE_CLASSPATH=lib/junit.jar:$ANT_JARS:"$builddir"/../make/lib/TestJarsInJar.jar:"$builddir"/gluegen-rt-alt.jar:"$builddir"/gluegen.jar:"$builddir"/test/build/gluegen-test.jar libspath="$builddir"/test/build/natives - #CLASSPATH=lib/junit.jar:$ANT_JARS:"$builddir"/../make/lib/TestJarsInJar.jar:"$builddir"/classes:"$builddir"/test/build/classes + #USE_CLASSPATH=lib/junit.jar:$ANT_JARS:"$builddir"/../make/lib/TestJarsInJar.jar:"$builddir"/classes:"$builddir"/test/build/classes #libspath="$builddir"/obj:"$builddir"/test/build/natives: LD_LIBRARY_PATH=$libspath:$LD_LIBRARY_PATH DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH export LD_LIBRARY_PATH DYLD_LIBRARY_PATH echo LD_LIBRARY_PATH $LD_LIBRARY_PATH - echo CLASSPATH $CLASSPATH + echo USE_CLASSPATH $USE_CLASSPATH which java - #echo java -cp $CLASSPATH $D_ARGS -Djava.library.path=$libspath $clazz - #java -cp $CLASSPATH $D_ARGS -Djava.library.path="$libspath" $* - echo java -cp "$CLASSPATH" $D_ARGS $clazz - java -cp "$CLASSPATH" $D_ARGS $* - #echo java -cp $CLASSPATH $D_ARGS $clazz - #java -cp $CLASSPATH $D_ARGS $* + #echo java -cp $USE_CLASSPATH $D_ARGS -Djava.library.path=$libspath $* + #java -cp $USE_CLASSPATH $D_ARGS -Djava.library.path="$libspath" $* + echo java -cp "$USE_CLASSPATH" $D_ARGS $* + java -cp "$USE_CLASSPATH" $D_ARGS $* + #j3 -cp "$USE_CLASSPATH" $D_ARGS $* echo } # @@ -103,11 +103,11 @@ function onetest() { #onetest com.jogamp.common.util.TestValueConversion 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestSyncRingBuffer01 $* #onetest com.jogamp.common.util.TestLFRingBuffer01 $* -onetest com.jogamp.common.util.TestBitstream00 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream01 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream02 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream03 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream04 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream00 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream01 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream02 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream03 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream04 2>&1 | tee -a $LOG #onetest com.jogamp.common.net.TestUrisWithAssetHandler 2>&1 | tee -a $LOG #onetest com.jogamp.common.net.TestURIQueryProps 2>&1 | tee -a $LOG #onetest com.jogamp.common.net.AssetURLConnectionUnregisteredTest 2>&1 | tee -a $LOG @@ -119,6 +119,7 @@ onetest com.jogamp.common.util.TestBitstream04 2>&1 | tee -a $LOG #onetest com.jogamp.common.os.TestElfReader01 2>&1 | tee -a $LOG #onetest com.jogamp.gluegen.PCPPTest 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.gluegen.test.junit.generation.Test1p2ProcAddressEmitter 2>&1 | tee -a $LOG +#onetest com.jogamp.gluegen.test.junit.generation.Test1p2LoadJNIAndImplLib 2>&1 | tee -a $LOG #onetest com.jogamp.gluegen.test.junit.structgen.TestStructGen01 2>&1 | tee -a $LOG diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2LoadJNIAndImplLib.java b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2LoadJNIAndImplLib.java new file mode 100644 index 0000000..b16194e --- /dev/null +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2LoadJNIAndImplLib.java @@ -0,0 +1,77 @@ +/** + * Copyright 2010 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ + +package com.jogamp.gluegen.test.junit.generation; + +import com.jogamp.gluegen.test.junit.generation.impl.Bindingtest1p2Impl; +import com.jogamp.common.os.NativeLibrary; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class Test1p2LoadJNIAndImplLib extends BaseClass { + + static NativeLibrary dynamicLookupHelper; + + /** + * Verifies loading of the new library. + */ + @BeforeClass + public static void chapter01TestLoadLibrary() throws Exception { + BindingJNILibLoader.loadBindingtest1p2(); + dynamicLookupHelper = NativeLibrary.open("test1", Test1p2LoadJNIAndImplLib.class.getClassLoader(), true); + Assert.assertNotNull("NativeLibrary.open(test1) failed", dynamicLookupHelper); + + Bindingtest1p2Impl.resetProcAddressTable(dynamicLookupHelper); + } + + /** + * Verifies the existence and creation of the generated class. + */ + @Test + public void chapter02TestClassExist() throws Exception { + testClassExist("test1p2"); + } + + + @SuppressWarnings("unused") + public static void main(String args[]) throws Exception { + if( true ) { + chapter01TestLoadLibrary(); + Test1p2LoadJNIAndImplLib tst = new Test1p2LoadJNIAndImplLib(); + tst.chapter02TestClassExist(); + } else { + String tstname = Test1p2LoadJNIAndImplLib.class.getName(); + org.junit.runner.JUnitCore.main(tstname); + } + } +} -- cgit v1.2.3