summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-04-27 18:00:20 +0200
committerSven Gothel <[email protected]>2010-04-27 18:00:20 +0200
commitb5fc2499749d9c180d3e5a0e04a939bd78017068 (patch)
treed47913fe1c907b929ec0359c0dc87a541142cf9f
parent2e99ad22783143067887881665a6204ac0e47d91 (diff)
Relax Junit: TestOffscreen01NEWT, ie no failure if no PBuffer available
-rw-r--r--make/setenv-jogl.sh20
-rwxr-xr-xsrc/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java30
2 files changed, 43 insertions, 7 deletions
diff --git a/make/setenv-jogl.sh b/make/setenv-jogl.sh
index 49c584459..f7d42a193 100644
--- a/make/setenv-jogl.sh
+++ b/make/setenv-jogl.sh
@@ -7,7 +7,7 @@ function print_usage() {
if [ -z "$1" ] ; then
echo JOGL BUILD DIR missing
print_usage
- return
+ exit
fi
if [ -e /devtools/etc/profile.ant ] ; then
@@ -27,7 +27,7 @@ if [ -e "$JOGL_BUILDDIR" ] ; then
else
echo JOGL_BUILDDIR $JOGL_BUILDDIR not exist or not given
print_usage
- return
+ exit
fi
gpf=`find ../../gluegen/make -name dynlink-unix.cfg`
@@ -37,7 +37,7 @@ fi
if [ -z "$gpf" ] ; then
echo GLUEGEN_BUILDDIR not found
print_usage
- return
+ exit
fi
GLUEGEN_DIR=`dirname $gpf`/..
@@ -45,19 +45,25 @@ GLUEGEN_BUILDDIR=$GLUEGEN_DIR/$JOGL_BUILDDIR_BASE
if [ ! -e "$GLUEGEN_BUILDDIR" ] ; then
echo GLUEGEN_BUILDDIR $GLUEGEN_BUILDDIR does not exist
print_usage
- return
+ exit
fi
GLUEGEN_JAR=$GLUEGEN_BUILDDIR/gluegen-rt.jar
GLUEGEN_OS=$GLUEGEN_BUILDDIR/obj
JUNIT_JAR=$GLUEGEN_DIR/make/lib/junit-4.5.jar
if [ -z "$ANT_PATH" ] ; then
+ if [ -e /usr/share/ant/bin/ant -a -e /usr/share/ant/lib/ant.jar ] ; then
+ ANT_PATH=/usr/share/ant
+ export ANT_PATH
+ echo autosetting ANT_PATH to $ANT_PATH
+ fi
+fi
+if [ -z "$ANT_PATH" ] ; then
echo ANT_PATH does not exist, set it
print_usage
- return
-else
- ANT_JARS=$ANT_PATH/lib/ant.jar:$ANT_PATH/lib/ant-junit.jar
+ exit
fi
+ANT_JARS=$ANT_PATH/lib/ant.jar:$ANT_PATH/lib/ant-junit.jar
echo GLUEGEN BUILDDIR: $GLUEGEN_BUILDDIR
echo JOGL DIR: $JOGL_DIR
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
index 67d1d5138..54ee06a84 100755
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
+++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
@@ -57,6 +57,7 @@ import java.io.IOException;
public class TestOffscreen01NEWT {
static GLProfile glpDefault;
+ static GLDrawableFactory glDrawableFactory;
static int width, height;
GLCapabilities capsDefault;
@@ -64,6 +65,7 @@ public class TestOffscreen01NEWT {
public static void initClass() {
glpDefault = GLProfile.getDefault();
Assert.assertNotNull(glpDefault);
+ glDrawableFactory = GLDrawableFactory.getFactory(glpDefault);
width = 640;
height = 480;
}
@@ -112,12 +114,20 @@ public class TestOffscreen01NEWT {
@Test
public void test01aOffscreenWindowPBuffer() {
+ if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+ System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+ return;
+ }
GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
do01OffscreenWindowPBuffer(caps2);
}
@Test
public void test01bOffscreenWindowPBufferStencil() {
+ if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+ System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+ return;
+ }
GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
caps2.setStencilBits(8);
do01OffscreenWindowPBuffer(caps2);
@@ -125,6 +135,10 @@ public class TestOffscreen01NEWT {
@Test
public void test01cOffscreenWindowPBufferStencilAlpha() {
+ if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+ System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+ return;
+ }
GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
caps2.setStencilBits(8);
caps2.setAlphaBits(8);
@@ -133,6 +147,10 @@ public class TestOffscreen01NEWT {
@Test
public void test01cOffscreenWindowPBuffer555() {
+ if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+ System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+ return;
+ }
GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
caps2.setRedBits(5);
caps2.setGreenBits(5);
@@ -142,6 +160,10 @@ public class TestOffscreen01NEWT {
@Test
public void test02Offscreen3Windows1DisplayPBuffer() {
+ if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+ System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+ return;
+ }
GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
int winnum = 3, i;
Window windows[] = new Window[winnum];
@@ -189,6 +211,10 @@ public class TestOffscreen01NEWT {
@Test
public void test03Offscreen3Windows3DisplaysPBuffer() {
+ if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+ System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+ return;
+ }
GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
int winnum = 3, i;
Display displays[] = new Display[winnum];
@@ -237,6 +263,10 @@ public class TestOffscreen01NEWT {
@Test
public void test04OffscreenSnapshotWithDemoPBuffer() {
+ if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+ System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+ return;
+ }
GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
System.out.println("Create Window 1");