summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-05 18:47:56 +0100
committerSven Gothel <[email protected]>2013-11-05 18:47:56 +0100
commit44117f78f5d4fb3329409a92d758562d013298af (patch)
tree24f835694ca71f08a0b93c06ec33f712304f2144
parent1d426dd08797a3164e0a7cdf6007d3e750650265 (diff)
Bug 888 / Bug 891- Enhance GLCapabilities-Query: Refine unit tests
-rwxr-xr-xmake/scripts/tests-win.bat4
-rw-r--r--make/scripts/tests.sh4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java15
5 files changed, 30 insertions, 19 deletions
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index 6550c45eb..7e40967c2 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -75,9 +75,9 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintin
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit01AWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 69ad8c2aa..f2231a0de 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -334,9 +334,9 @@ function testawtswt() {
#
# performance tests
#
-testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT $*
#testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit01AWT $*
-#testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT $*
+testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT $*
#
# tile rendring / printing w/ & w/o AWT
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 d47058857..24bd1b748 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
@@ -185,24 +185,23 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
@Test
public void test01NopGLJPanel() throws InterruptedException, InvocationTargetException {
- final int width = 800, height = 600, rows = 5, cols = 5;
test(false /*useGears*/, width, height, rows, cols, true /* useGLJPanel */, false /*useAnim*/);
}
@Test
public void test02NopGLCanvas() throws InterruptedException, InvocationTargetException {
- final int width = 800, height = 600, rows = 5, cols = 5;
test(false /*useGears*/, width, height, rows, cols, false /* useGLJPanel */, false /*useAnim*/);
}
- static long duration = 2000; // ms
+ static long duration = 0; // ms
static boolean wait = false;
+ static int width = 800, height = 600, rows = 5, cols = 5;
volatile int initCount = 0;
public static void main(String[] args) {
- int width = 800, height = 600, rows = 5, cols = 5;
boolean useGLJPanel = true, useGears = false, manual=false;
+ boolean waitMain = false;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -223,10 +222,16 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
} else if(args[i].equals("-wait")) {
wait = true;
manual = true;
+ } else if(args[i].equals("-waitMain")) {
+ waitMain = true;
+ manual = true;
} else if(args[i].equals("-manual")) {
manual = true;
}
}
+ if( waitMain ) {
+ UITestCase.waitForKey("Main-Start");
+ }
if( manual ) {
GLProfile.initSingleton();
TestPerf001GLJPanelInit01AWT demo = new TestPerf001GLJPanelInit01AWT();
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 3988b8054..0ac66f907 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
@@ -187,24 +187,23 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
@Test
public void test01NopGLJPanel() throws InterruptedException, InvocationTargetException {
- final int width = 800, height = 600, frameCount = 25;
test(false /*useGears*/, width, height, frameCount , true /* useGLJPanel */, false /*useAnim*/);
}
@Test
public void test02NopGLCanvas() throws InterruptedException, InvocationTargetException {
- final int width = 800, height = 600, frameCount = 25;
test(false /*useGears*/, width, height, frameCount , false /* useGLJPanel */, false /*useAnim*/);
}
- static long duration = 2000; // ms
+ static long duration = 0; // ms
static boolean wait = false;
+ static int width = 800, height = 600, frameCount = 25;
volatile int initCount = 0;
public static void main(String[] args) {
- int width = 800, height = 600, frameCount = 25;
boolean useGLJPanel = true, useGears = false, manual=false;
+ boolean waitMain = false;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -223,10 +222,16 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
} else if(args[i].equals("-wait")) {
wait = true;
manual = true;
+ } else if(args[i].equals("-waitMain")) {
+ waitMain = true;
+ manual = true;
} else if(args[i].equals("-manual")) {
manual = true;
}
}
+ if( waitMain ) {
+ UITestCase.waitForKey("Main-Start");
+ }
if( manual ) {
GLProfile.initSingleton();
TestPerf001GLJPanelInit02AWT demo = new TestPerf001GLJPanelInit02AWT();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
index 772ab3107..6f7d9329b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
@@ -70,7 +70,7 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
final GLCapabilitiesImmutable caps = new GLCapabilities(glp);
final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(screen.getDisplay().getGraphicsDevice(), caps);
- if( wait && 1 == runNum ) {
+ if( wait && 0 == runNum ) {
UITestCase.waitForKey("Pre-Init");
}
System.err.println("INIT START #"+runNum);
@@ -103,7 +103,7 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
final GLProfile glp = GLProfile.getGL2ES2();
final GLCapabilitiesImmutable caps = new GLCapabilities(glp);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
- if( wait && 1 == runNum ) {
+ if( wait && 0 == runNum ) {
UITestCase.waitForKey("Pre-Init");
}
System.err.println("INIT START #"+runNum);
@@ -181,7 +181,6 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
if( 0 != manualTest && 1 != manualTest ) {
return;
}
- final int count = 50;
final Display display = NewtFactory.createDisplay(null, false);
final Screen screen = NewtFactory.createScreen(display, 0);
screen.addReference();
@@ -199,7 +198,6 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
if( 0 != manualTest && 2 != manualTest ) {
return;
}
- final int width = 800, height = 600, count = 50;
testFull(0, width, height, count); // warm-up
testFull(1, width, height, count);
testFull(2, width, height, count);
@@ -207,9 +205,10 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
static boolean wait = false;
static int manualTest = 0;
+ static int width = 800, height = 600, count = 50;
public static void main(String[] args) {
- int width = 800, height = 600, count = 50;
+ boolean waitMain = false;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-width")) {
@@ -220,12 +219,14 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
count = MiscUtils.atoi(args[++i], count);
} else if(args[i].equals("-wait")) {
wait = true;
+ } else if(args[i].equals("-waitMain")) {
+ waitMain = true;
} else if(args[i].equals("-test")) {
manualTest = MiscUtils.atoi(args[++i], manualTest);
}
}
- if( wait ) {
- UITestCase.waitForKey("Main");
+ if( waitMain ) {
+ UITestCase.waitForKey("Main-Start");
}
org.junit.runner.JUnitCore.main(TestPerf001RawInit00NEWT.class.getName());
}