From 397665ff472d83809a028e4f4a5d332294617623 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 25 Feb 2012 23:40:36 +0100 Subject: UITestCase: Gracely ignore unsupported tests (ES2) ; Ignore all Shared-Context and more 'known' test cases for ES. --- .../test/junit/graph/TestRegionRendererNEWT01.java | 12 ++ .../test/junit/graph/TestTextRendererNEWT01.java | 6 + .../junit/jogl/acore/TestSharedContextListAWT.java | 4 +- .../jogl/acore/TestSharedContextListNEWT.java | 4 +- .../jogl/acore/TestSharedContextListNEWT2.java | 4 +- .../jogl/acore/TestSharedContextNewtAWTBug523.java | 4 +- .../jogl/acore/TestSharedContextVBOES1NEWT.java | 6 + .../jogl/acore/TestSharedContextVBOES2NEWT.java | 7 ++ .../jogl/acore/TestSharedContextVBOES2NEWT2.java | 7 ++ .../junit/jogl/demos/es2/awt/TestGearsES2AWT.java | 132 +++++++++++++++++++++ .../junit/jogl/demos/gl2/awt/TestGearsAWT.java | 12 +- .../demos/gl2/awt/TestGearsAWTAnalyzeBug455.java | 12 +- .../jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java | 12 +- .../demos/gl2/awt/TestGearsGLJPanelAWTBug450.java | 12 +- .../junit/jogl/demos/gl2/newt/TestGearsNEWT.java | 15 +-- .../demos/gl2/newt/TestGearsNewtAWTWrapper.java | 12 +- .../jogl/offscreen/TestOffscreen02BitmapNEWT.java | 6 +- .../jogamp/opengl/test/junit/util/UITestCase.java | 3 +- 18 files changed, 230 insertions(+), 40 deletions(-) create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java (limited to 'src') diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java index 6db500ae8..a723e120a 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java @@ -12,6 +12,7 @@ import javax.media.opengl.GLProfile; import org.junit.Assert; import org.junit.Test; +import com.jogamp.common.os.Platform; import com.jogamp.graph.curve.Region; import com.jogamp.graph.curve.opengl.RenderState; import com.jogamp.graph.geom.opengl.SVertex; @@ -51,6 +52,11 @@ public class TestRegionRendererNEWT01 extends UITestCase { @Test public void testRegionRendererR2T01() throws InterruptedException { + if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME + // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise). + setTestSupported(false); + return; + } GLProfile glp = GLProfile.getGL2ES2(); GLCapabilities caps = new GLCapabilities(glp); @@ -111,6 +117,12 @@ public class TestRegionRendererNEWT01 extends UITestCase { @Test public void testRegionRendererMSAA02() throws InterruptedException { + if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME + // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise). + // FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet! + setTestSupported(false); + return; + } GLProfile glp = GLProfile.get(GLProfile.GL2ES2); GLCapabilities caps = new GLCapabilities(glp); caps.setAlphaBits(4); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java index 5a5f9debb..f9c88dc30 100755 --- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java @@ -13,6 +13,7 @@ import javax.media.opengl.GLProfile; import org.junit.Assert; import org.junit.Test; +import com.jogamp.common.os.Platform; import com.jogamp.graph.curve.Region; import com.jogamp.graph.curve.opengl.RenderState; import com.jogamp.graph.curve.opengl.TextRenderer; @@ -74,6 +75,11 @@ public class TestTextRendererNEWT01 extends UITestCase { @Test public void testTextRendererR2T01() throws InterruptedException { + if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME + // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise). + setTestSupported(false); + return; + } GLProfile glp = GLProfile.getGL2ES2(); GLCapabilities caps = new GLCapabilities(glp); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java index b3035ff41..60502bab1 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java @@ -59,8 +59,8 @@ public class TestSharedContextListAWT extends UITestCase { @BeforeClass public static void initClass() { if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME - // Turns out on some platforms (Linux ARM), - // Mesa3D software impl. freezes when shared context is used. + // FIXME: Turns out on some mobile GL drivers and platforms + // using shared context is instable, Linux ARM (Omap4, Tegra2, Mesa3d, ..) setTestSupported(false); return; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java index 8beb7a0c8..39367d1b0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java @@ -58,8 +58,8 @@ public class TestSharedContextListNEWT extends UITestCase { @BeforeClass public static void initClass() { if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME - // Turns out on some platforms (Linux ARM), - // Mesa3D software impl. freezes when shared context is used. + // FIXME: Turns out on some mobile GL drivers and platforms + // using shared context is instable, Linux ARM (Omap4, Tegra2, Mesa3d, ..) setTestSupported(false); return; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java index 89617fc78..7dca314bd 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java @@ -56,8 +56,8 @@ public class TestSharedContextListNEWT2 extends UITestCase { @BeforeClass public static void initClass() { if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME - // Turns out on some platforms (Linux ARM), - // Mesa3D software impl. freezes when shared context is used. + // FIXME: Turns out on some mobile GL drivers and platforms + // using shared context is instable, Linux ARM (Omap4, Tegra2, Mesa3d, ..) setTestSupported(false); return; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java index 3e68643a9..bc2eddb9a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java @@ -119,8 +119,8 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase { @BeforeClass public static void initClass() { if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME - // Turns out on some platforms (Linux ARM), - // Mesa3D software impl. freezes when shared context is used. + // FIXME: Turns out on some mobile GL drivers and platforms + // using shared context is instable, Linux ARM (Omap4, Tegra2, Mesa3d, ..) setTestSupported(false); return; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java index ff46347ed..707bd5a9b 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java @@ -55,6 +55,12 @@ public class TestSharedContextVBOES1NEWT extends UITestCase { @BeforeClass public static void initClass() { + if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME + // FIXME: Turns out on some mobile GL drivers and platforms + // using shared context is instable, Linux ARM (Omap4, Tegra2, Mesa3d, ..) + setTestSupported(false); + return; + } if(GLProfile.isAvailable(GLProfile.GL2ES1)) { glp = GLProfile.get(GLProfile.GL2ES1); Assert.assertNotNull(glp); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT.java index 1286560bb..ce2bd77e1 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT.java @@ -28,6 +28,7 @@ package com.jogamp.opengl.test.junit.jogl.acore; +import com.jogamp.common.os.Platform; import com.jogamp.newt.opengl.GLWindow; import javax.media.nativewindow.util.InsetsImmutable; @@ -54,6 +55,12 @@ public class TestSharedContextVBOES2NEWT extends UITestCase { @BeforeClass public static void initClass() { + if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME + // FIXME: Turns out on some mobile GL drivers and platforms + // using shared context is instable, Linux ARM (Omap4, Tegra2, Mesa3d, ..) + setTestSupported(false); + return; + } if(GLProfile.isAvailable(GLProfile.GL2ES2)) { glp = GLProfile.get(GLProfile.GL2ES2); Assert.assertNotNull(glp); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java index c4752bb30..8911e73ef 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java @@ -30,6 +30,7 @@ package com.jogamp.opengl.test.junit.jogl.acore; import java.io.IOException; +import com.jogamp.common.os.Platform; import com.jogamp.newt.opengl.GLWindow; import javax.media.nativewindow.util.InsetsImmutable; @@ -54,6 +55,12 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase { @BeforeClass public static void initClass() { + if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME + // FIXME: Turns out on some mobile GL drivers and platforms + // using shared context is instable, Linux ARM (Omap4, Tegra2, Mesa3d, ..) + setTestSupported(false); + return; + } if(GLProfile.isAvailable(GLProfile.GL2ES2)) { glp = GLProfile.get(GLProfile.GL2ES2); Assert.assertNotNull(glp); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java new file mode 100644 index 000000000..e2b1e4844 --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java @@ -0,0 +1,132 @@ +/** + * 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.opengl.test.junit.jogl.demos.es2.awt; + +import javax.media.opengl.*; + +import com.jogamp.opengl.util.Animator; +import javax.media.opengl.awt.GLCanvas; +import com.jogamp.newt.event.awt.AWTKeyAdapter; +import com.jogamp.newt.event.awt.AWTWindowAdapter; +import com.jogamp.newt.event.TraceKeyAdapter; +import com.jogamp.newt.event.TraceWindowAdapter; + +import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.test.junit.util.UITestCase; +import com.jogamp.opengl.test.junit.util.QuitAdapter; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.AfterClass; +import org.junit.Test; + +public class TestGearsES2AWT extends UITestCase { + static GLProfile glp; + static int width, height; + static boolean firstUIActionOnProcess = false; + + @BeforeClass + public static void initClass() { + glp = GLProfile.getGL2ES2(); + Assert.assertNotNull(glp); + width = 512; + height = 512; + } + + @AfterClass + public static void releaseClass() { + } + + protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException { + final Frame frame = new Frame("GearsES2 AWT Test"); + Assert.assertNotNull(frame); + + final GLCanvas glCanvas = new GLCanvas(caps); + Assert.assertNotNull(glCanvas); + frame.add(glCanvas); + frame.setSize(512, 512); + + glCanvas.addGLEventListener(new GearsES2(1)); + + Animator animator = new Animator(glCanvas); + QuitAdapter quitAdapter = new QuitAdapter(); + + new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas); + new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame); + + javax.swing.SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame.setVisible(true); + }}); + animator.setUpdateFPSFrames(60, System.err); + animator.start(); + + while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()= GL3 (ATI) - GLProfile glp = GLProfile.get(GLProfile.GL2); + GLProfile glp = GLProfile.getGL2ES1(); Assert.assertNotNull(glp); GLCapabilities caps = new GLCapabilities(glp); Assert.assertNotNull(caps); @@ -124,8 +123,7 @@ public class TestOffscreen02BitmapNEWT extends UITestCase { @Test public void test14OffscreenSnapshotWithDemoPixmap() { - // Offscreen doesn't work on >= GL3 (ATI) - GLProfile glp = GLProfile.get(GLProfile.GL2); + GLProfile glp = GLProfile.getGL2ES1(); Assert.assertNotNull(glp); GLCapabilities caps = new GLCapabilities(glp); Assert.assertNotNull(caps); diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java index 879c8b161..cc5986f28 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java +++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java @@ -31,6 +31,7 @@ package com.jogamp.opengl.test.junit.util; import com.jogamp.common.os.Platform; import com.jogamp.common.util.locks.SingletonInstance; +import org.junit.Assume; import org.junit.Before; import org.junit.BeforeClass; import org.junit.After; @@ -98,7 +99,7 @@ public abstract class UITestCase { System.err.print("++++ UITestCase.setUp: "+getFullTestName(" - ")); if(!testSupported) { System.err.println(" - "+unsupportedTestMsg); - throw new UnsupportedOperationException(unsupportedTestMsg); + Assume.assumeTrue(testSupported); } System.err.println(); } -- cgit v1.2.3