diff options
Diffstat (limited to 'src/test')
5 files changed, 72 insertions, 23 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java index ce8f9adc8..48c3c89b3 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java @@ -51,17 +51,21 @@ import org.junit.BeforeClass; import org.junit.Test; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; public class TestAddRemove01GLCanvasSwingAWT extends UITestCase { static long durationPerTest = 50; static int addRemoveCount = 15; + static int pauseEach = 0; + static int pauseDuration = 500; static boolean noOnscreenTest = false; static boolean noOffscreenTest = false; static boolean shallUseOffscreenPBufferLayer = false; static GLProfile glp; static int width, height; static boolean waitForKey = false; + static boolean waitForKeyPost = false; @BeforeClass public static void initClass() { @@ -167,9 +171,19 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase { } while ( ( System.currentTimeMillis() - t0 ) < durationPerTest ) ; System.err.println("GLCanvas isOffscreenLayerSurfaceEnabled: "+glc.isOffscreenLayerSurfaceEnabled()+": "+glc.getChosenGLCapabilities()); + + dispose(top[0]); - dispose(top[0]); + if( 0 < pauseEach && 0 == i % pauseEach ) { + System.err.println("******* P A U S E - Start ********"); + // OSXUtil.WaitUntilFinish(); + Thread.sleep(pauseDuration); + System.err.println("******* P A U S E - End ********"); + } } + if(waitForKeyPost) { + UITestCase.waitForKey("End"); + } } @Test @@ -213,9 +227,13 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase { } catch (Exception ex) { ex.printStackTrace(); } } else if(args[i].equals("-loops")) { i++; - try { - addRemoveCount = Integer.parseInt(args[i]); - } catch (Exception ex) { ex.printStackTrace(); } + addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount); + } else if(args[i].equals("-pauseEach")) { + i++; + pauseEach = MiscUtils.atoi(args[i], pauseEach); + } else if(args[i].equals("-pauseDuration")) { + i++; + pauseDuration = MiscUtils.atoi(args[i], pauseDuration); } else if(args[i].equals("-noOnscreen")) { noOnscreenTest = true; } else if(args[i].equals("-noOffscreen")) { @@ -224,11 +242,15 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase { shallUseOffscreenPBufferLayer = true; } else if(args[i].equals("-wait")) { waitForKey = true; - } + } else if(args[i].equals("-waitPost")) { + waitForKeyPost = true; + } } System.err.println("waitForKey "+waitForKey); System.err.println("addRemoveCount "+addRemoveCount); + System.err.println("pauseEach "+pauseEach); + System.err.println("pauseDuration "+pauseDuration); System.err.println("noOnscreenTest "+noOnscreenTest); System.err.println("noOffscreenTest "+noOffscreenTest); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java index 3d78943f9..ce88abfba 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java @@ -53,11 +53,14 @@ import org.junit.Test; import com.jogamp.newt.awt.NewtCanvasAWT; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase { static long durationPerTest = 50; static int addRemoveCount = 15; + static int pauseEach = 0; + static int pauseDuration = 500; static boolean noOnscreenTest = false; static boolean noOffscreenTest = false; static boolean shallUseOffscreenPBufferLayer = false; @@ -174,6 +177,11 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase { dispose(top[0]); glw.destroy(); + + if( 0 < pauseEach && 0 == i % pauseEach ) { + System.err.println("******* P A U S E ********"); + Thread.sleep(pauseDuration); + } } } @@ -218,9 +226,13 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase { } catch (Exception ex) { ex.printStackTrace(); } } else if(args[i].equals("-loops")) { i++; - try { - addRemoveCount = Integer.parseInt(args[i]); - } catch (Exception ex) { ex.printStackTrace(); } + addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount); + } else if(args[i].equals("-pauseEach")) { + i++; + pauseEach = MiscUtils.atoi(args[i], pauseEach); + } else if(args[i].equals("-pauseDuration")) { + i++; + pauseDuration = MiscUtils.atoi(args[i], pauseDuration); } else if(args[i].equals("-noOnscreen")) { noOnscreenTest = true; } else if(args[i].equals("-noOffscreen")) { @@ -234,6 +246,8 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase { System.err.println("waitForKey "+waitForKey); System.err.println("addRemoveCount "+addRemoveCount); + System.err.println("pauseEach "+pauseEach); + System.err.println("pauseDuration "+pauseDuration); System.err.println("noOnscreenTest "+noOnscreenTest); System.err.println("noOffscreenTest "+noOffscreenTest); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java index 9d7a4026b..981b14af3 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java @@ -41,11 +41,14 @@ import org.junit.Test; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; public class TestAddRemove03GLWindowNEWT extends UITestCase { static long durationPerTest = 50; static int addRemoveCount = 15; + static int pauseEach = 0; + static int pauseDuration = 500; static GLProfile glp; static int width, height; static boolean waitForKey = false; @@ -91,6 +94,11 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase { System.err.println("GLWindow: "+glw.getChosenGLCapabilities()); glw.destroy(); + + if( 0 < pauseEach && 0 == i % pauseEach ) { + System.err.println("******* P A U S E ********"); + Thread.sleep(pauseDuration); + } } } @@ -111,9 +119,13 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase { } catch (Exception ex) { ex.printStackTrace(); } } else if(args[i].equals("-loops")) { i++; - try { - addRemoveCount = Integer.parseInt(args[i]); - } catch (Exception ex) { ex.printStackTrace(); } + addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount); + } else if(args[i].equals("-pauseEach")) { + i++; + pauseEach = MiscUtils.atoi(args[i], pauseEach); + } else if(args[i].equals("-pauseDuration")) { + i++; + pauseDuration = MiscUtils.atoi(args[i], pauseDuration); } else if(args[i].equals("-wait")) { waitForKey = true; } @@ -121,6 +133,8 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase { System.err.println("waitForKey "+waitForKey); System.err.println("addRemoveCount "+addRemoveCount); + System.err.println("pauseEach "+pauseEach); + System.err.println("pauseDuration "+pauseDuration); if(waitForKey) { UITestCase.waitForKey("Start"); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java index 0673e2f45..0b70cf151 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java @@ -64,6 +64,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase; public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { static final int widthStep = 800/4; static final int heightStep = 600/4; + static boolean waitForKey = false; volatile int szStep = 2; static GLCapabilities getCaps(String profile) { @@ -331,6 +332,14 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { } public static void main(String args[]) throws IOException { + for(int i=0; i<args.length; i++) { + if(args[i].equals("-wait")) { + waitForKey = true; + } + } + if(waitForKey) { + UITestCase.waitForKey("Start"); + } org.junit.runner.JUnitCore.main(TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.class.getName()); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java index 47891a8df..14b1f04b0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java @@ -28,9 +28,7 @@ package com.jogamp.opengl.test.junit.jogl.demos.es2.newt; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import com.jogamp.newt.Display; import com.jogamp.newt.NewtFactory; @@ -130,11 +128,7 @@ public class TestGearsES2NEWT extends UITestCase { public void display(GLAutoDrawable drawable) { GLAnimatorControl actrl = drawable.getAnimator(); if(waitForKey && actrl.getTotalFPSFrames() == 60*3) { - BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); - System.err.println("Press enter to continue"); - try { - System.err.println(stdin.readLine()); - } catch (IOException e) { } + UITestCase.waitForKey("3s mark"); actrl.resetFPSCounter(); waitForKey = false; } @@ -418,11 +412,7 @@ public class TestGearsES2NEWT extends UITestCase { System.err.println("exclusiveContext "+exclusiveContext); if(waitForKey) { - BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); - System.err.println("Press enter to continue"); - try { - System.err.println(stdin.readLine()); - } catch (IOException e) { } + UITestCase.waitForKey("Start"); } org.junit.runner.JUnitCore.main(TestGearsES2NEWT.class.getName()); } |