aboutsummaryrefslogtreecommitdiffstats
path: root/src
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 /src
parent1d426dd08797a3164e0a7cdf6007d3e750650265 (diff)
Bug 888 / Bug 891- Enhance GLCapabilities-Query: Refine unit tests
Diffstat (limited to 'src')
-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
3 files changed, 26 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 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());
}