diff options
Diffstat (limited to 'src/test/com/jogamp/opengl')
3 files changed, 30 insertions, 15 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java index 0472fdb31..0ca84e4c3 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java @@ -61,6 +61,7 @@ import com.jogamp.opengl.util.Animator; */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestPerf001GLJPanelInit01AWT extends UITestCase { + final long INIT_TIMEOUT = 10L*1000L; // 10s @BeforeClass public static void initClass() { @@ -119,22 +120,26 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase { throwable.printStackTrace(); Assume.assumeNoException( throwable ); } - while( panelCount > initCount ) { + final long t0 = System.currentTimeMillis(); + long t1 = t0; + while( panelCount > initCount && INIT_TIMEOUT > t1 - t0 ) { try { - Thread.sleep(10); + Thread.sleep(100); + System.err.println("Sleep initialized: "+initCount+"/"+panelCount); } catch (InterruptedException e1) { e1.printStackTrace(); } + t1 = System.currentTimeMillis(); } t[3] = Platform.currentTimeMillis(); - final double panelCountF = panelCount; + final double panelCountF = initCount; System.err.printf("P: %d %s:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n", - panelCount, + initCount, useGLJPanel?"GLJPanel":"GLCanvas", t[1]-t[0], (t[1]-t[0])/panelCountF, t[3]-t[1], (t[3]-t[1])/panelCountF, t[3]-t[0], (t[3]-t[0])/panelCountF); - System.err.println("INIT END: "+initCount); + System.err.println("INIT END: "+initCount+"/"+panelCount); if( wait ) { UITestCase.waitForKey("Post-Init"); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java index b513af9a0..2b1dc411f 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java @@ -63,6 +63,7 @@ import com.jogamp.opengl.util.Animator; */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestPerf001GLJPanelInit02AWT extends UITestCase { + final long INIT_TIMEOUT = 10L*1000L; // 10s @BeforeClass public static void initClass() { @@ -175,23 +176,27 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase { throwable.printStackTrace(); Assume.assumeNoException( throwable ); } - while( frameCount > initCount ) { + final long t0 = System.currentTimeMillis(); + long t1 = t0; + while( frameCount > initCount && INIT_TIMEOUT > t1 - t0 ) { try { - Thread.sleep(10); + Thread.sleep(100); + System.err.println("Sleep initialized: "+initCount+"/"+frameCount); } catch (InterruptedException e1) { e1.printStackTrace(); } + t1 = System.currentTimeMillis(); } t[3] = Platform.currentTimeMillis(); - final double panelCountF = frameCount; + final double panelCountF = initCount; System.err.printf("P: %d %s%s:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n", - frameCount, + initCount, useGLJPanel?"GLJPanel":(useGLCanvas?"GLCanvas":"No_GL"), initMT?" (mt)":" (01)", t[1]-t[0], (t[1]-t[0])/panelCountF, t[3]-t[1], (t[3]-t[1])/panelCountF, t[3]-t[0], (t[3]-t[0])/panelCountF); - System.err.println("INIT END: "+initCount); + System.err.println("INIT END: "+initCount+"/"+frameCount); if( wait ) { UITestCase.waitForKey("Post-Init"); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java index 4915cffa6..18b3d5454 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java @@ -53,6 +53,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase; */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestPerf001GLWindowInit03NEWT extends UITestCase { + final long INIT_TIMEOUT = 10L*1000L; // 10s @BeforeClass public static void initClass() { @@ -108,22 +109,26 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase { } t[2] = Platform.currentTimeMillis(); - while( frameCount > initCount ) { + final long t0 = System.currentTimeMillis(); + long t1 = t0; + while( frameCount > initCount && INIT_TIMEOUT > t1 - t0 ) { try { - Thread.sleep(10); + Thread.sleep(100); + System.err.println("Sleep initialized: "+initCount+"/"+frameCount); } catch (InterruptedException e1) { e1.printStackTrace(); } + t1 = System.currentTimeMillis(); } t[3] = Platform.currentTimeMillis(); - final double panelCountF = frameCount; + final double panelCountF = initCount; System.err.printf("P: %d GLWindow:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n", - frameCount, + initCount, t[1]-t[0], (t[1]-t[0])/panelCountF, t[3]-t[1], (t[3]-t[1])/panelCountF, t[3]-t[0], (t[3]-t[0])/panelCountF); - System.err.println("INIT END: "+initCount); + System.err.println("INIT END: "+initCount+"/"+frameCount); if( wait ) { UITestCase.waitForKey("Post-Init"); } |