aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-02 05:57:16 +0100
committerSven Gothel <[email protected]>2011-02-02 05:57:16 +0100
commit9129498d4c82684d0c2fe56fbe3f2bfa9e835d33 (patch)
treef85c3a0fe7656dc0c0af6c7045d5c5b74f885823
parente93ee652a80dd8f4f1f4d1f6a1075388856e2e5c (diff)
Fix SWT tests in due to changes, minor linux fix
-rw-r--r--make/build-test.xml10
-rw-r--r--nbproject/project.xml14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/OneTriangle.java (renamed from src/junit/com/jogamp/test/junit/jogl/swt/OneTriangle.java)6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT01GLn.java (renamed from src/junit/com/jogamp/test/junit/jogl/swt/TestSWT01GLn.java)82
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java (renamed from src/junit/com/jogamp/test/junit/jogl/swt/TestSWTAWT01GLn.java)104
5 files changed, 98 insertions, 118 deletions
diff --git a/make/build-test.xml b/make/build-test.xml
index b51e2e6c3..a2fbdd8b7 100644
--- a/make/build-test.xml
+++ b/make/build-test.xml
@@ -277,13 +277,11 @@
<jvmarg value="-Djava.library.path=${obj.all.paths}"/>
<!--
- <jvmarg value="-Dnewt.debug.EDT"/>
<jvmarg value="-Djogl.debug=all"/>
<jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
<jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
<jvmarg value="-Djogl.debug.GLSLState"/>
<jvmarg value="-Dnativewindow.debug=all"/>
- <jvmarg value="-Dnewt.debug=all"/>
<jvmarg value="-verbose:jni"/>
<jvmarg value="-client"/>
<jvmarg value="-d32"/>
@@ -306,20 +304,18 @@
</junit>
</target>
- <target name="junit.run.swt" depends="junit.run.setup" description="Runs all SWT and SWT_AWT tests.">
+ <target name="junit.run.swt" depends="test.compile" description="Runs all SWT and SWT_AWT tests.">
<!-- Test*SWT* -->
<junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
<env key="${system.env.library.path}" path="${obj.all.paths}"/>
<jvmarg value="-Djava.library.path=${obj.all.paths}"/>
<!--
- <jvmarg value="-Dnewt.debug.EDT"/>
<jvmarg value="-Djogl.debug=all"/>
<jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
<jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
<jvmarg value="-Djogl.debug.GLSLState"/>
<jvmarg value="-Dnativewindow.debug=all"/>
- <jvmarg value="-Dnewt.debug=all"/>
<jvmarg value="-verbose:jni"/>
<jvmarg value="-client"/>
<jvmarg value="-d32"/>
@@ -329,9 +325,9 @@
<formatter usefile="true" type="xml"/>
<classpath refid="junit_jogl_swt.run.classpath"/>
- <batchtest todir="${results.junit}">
+ <batchtest todir="${results.test}">
<fileset dir="${classes}">
- <include name="${java.dir.test}/**/Test*SWT*"/>
+ <include name="${java.dir.junit}/**/Test*SWT*"/>
<exclude name="**/*$$*"/>
<exclude name="**/newt/**"/>
</fileset>
diff --git a/nbproject/project.xml b/nbproject/project.xml
index be7660190..c666d1190 100644
--- a/nbproject/project.xml
+++ b/nbproject/project.xml
@@ -13,6 +13,11 @@
</properties>
<folders>
<source-folder>
+ <label>JOGL</label>
+ <location>.</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
<label>nativewindow gensrc</label>
<type>java</type>
<location>build/nativewindow/gensrc/classes</location>
@@ -48,11 +53,6 @@
<location>src/test</location>
<encoding>UTF-8</encoding>
</source-folder>
- <source-folder>
- <label>JOGL</label>
- <location>.</location>
- <encoding>UTF-8</encoding>
- </source-folder>
</folders>
<ide-actions>
<action name="build">
@@ -201,14 +201,14 @@
<package-root>src/nativewindow/classes</package-root>
<package-root>build/jogl/gensrc/classes</package-root>
<package-root>build/nativewindow/gensrc/classes</package-root>
- <classpath mode="compile">../gluegen/build/gluegen.jar:../gluegen/build/gluegen-rt.jar</classpath>
+ <classpath mode="compile">../gluegen/build/gluegen.jar:../gluegen/build/gluegen-rt.jar:make/lib/swt/gtk-linux-x86_64/swt-debug.jar</classpath>
<built-to>bin</built-to>
<source-level>1.4</source-level>
</compilation-unit>
<compilation-unit>
<package-root>src/test</package-root>
<unit-tests/>
- <classpath mode="compile">build/jogl/classes:build/jogl/gensrc/classes:build/newt/classes:build/nativewindow/classes:build/nativewindow/gensrc/classes:build/test/build/classes:${jdk.home}/lib/tools.jar:${ant.core.lib}:${ant.home}/lib/ant-junit.jar:../gluegen/make/lib/antlr.jar:../gluegen/make/lib/junit.jar:../gluegen/build/gluegen-rt.jar</classpath>
+ <classpath mode="compile">build/jogl/classes:build/jogl/gensrc/classes:build/newt/classes:build/nativewindow/classes:build/nativewindow/gensrc/classes:build/test/build/classes:${jdk.home}/lib/tools.jar:${ant.core.lib}:${ant.home}/lib/ant-junit.jar:../gluegen/make/lib/antlr.jar:../gluegen/make/lib/junit.jar:../gluegen/build/gluegen-rt.jar:make/lib/swt/gtk-linux-x86_64/swt-debug.jar</classpath>
<built-to>bin</built-to>
<source-level>1.5</source-level>
</compilation-unit>
diff --git a/src/junit/com/jogamp/test/junit/jogl/swt/OneTriangle.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/OneTriangle.java
index 030d82999..655e590a3 100644
--- a/src/junit/com/jogamp/test/junit/jogl/swt/OneTriangle.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/OneTriangle.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.test.junit.jogl.swt;
+package com.jogamp.opengl.test.junit.jogl.swt;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
@@ -40,7 +40,7 @@ import org.eclipse.swt.graphics.Rectangle;
*/
public class OneTriangle {
- public static void setup( GL2 gl, Rectangle rectangle ) {
+ public static void setup( GL2 gl, Rectangle rectangle ) {
gl.glMatrixMode( GL2.GL_PROJECTION );
gl.glLoadIdentity();
@@ -54,7 +54,7 @@ public class OneTriangle {
gl.glViewport( 0, 0, rectangle.width, rectangle.height );
}
- public static void render( GL2 gl, Rectangle rectangle ) {
+ public static void render( GL2 gl, Rectangle rectangle ) {
gl.glClear( GL.GL_COLOR_BUFFER_BIT );
// draw a triangle filling the window
diff --git a/src/junit/com/jogamp/test/junit/jogl/swt/TestSWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT01GLn.java
index c8880225c..94231a88d 100644
--- a/src/junit/com/jogamp/test/junit/jogl/swt/TestSWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT01GLn.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.test.junit.jogl.swt;
+package com.jogamp.opengl.test.junit.jogl.swt;
import javax.media.opengl.GL2;
import javax.media.opengl.GLContext;
@@ -53,7 +53,7 @@ import org.junit.BeforeClass;
import org.junit.After;
import org.junit.Test;
-import com.jogamp.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.UITestCase;
/**
* Tests that a basic SWT app can open without crashing under different GL profiles. Uses the SWT GL canvas.
@@ -61,7 +61,9 @@ import com.jogamp.test.junit.util.UITestCase;
*/
public class TestSWT01GLn extends UITestCase {
- Display display = null;
+ static final int duration = 250;
+
+ Display display = null;
Shell shell = null;
Composite composite = null;
GLCanvas glcanvas = null;
@@ -76,10 +78,10 @@ public class TestSWT01GLn extends UITestCase {
public void init() {
display = new Display();
Assert.assertNotNull( display );
- shell = new Shell( display );
+ shell = new Shell( display );
Assert.assertNotNull( shell );
- shell.setLayout( new FillLayout() );
- composite = new Composite( shell, SWT.NONE );
+ shell.setLayout( new FillLayout() );
+ composite = new Composite( shell, SWT.NONE );
composite.setLayout( new FillLayout() );
Assert.assertNotNull( composite );
}
@@ -91,18 +93,18 @@ public class TestSWT01GLn extends UITestCase {
Assert.assertNotNull( composite );
Assert.assertNotNull( glcanvas );
try {
- glcanvas.dispose();
- composite.dispose();
- shell.dispose();
- display.dispose();
+ glcanvas.dispose();
+ composite.dispose();
+ shell.dispose();
+ display.dispose();
}
catch( Throwable throwable ) {
- throwable.printStackTrace();
+ throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
display = null;
shell = null;
- composite = null;
+ composite = null;
glcanvas = null;
}
@@ -125,7 +127,7 @@ public class TestSWT01GLn extends UITestCase {
glcontext.makeCurrent();
GL2 gl = glcontext.getGL().getGL2();
OneTriangle.setup( gl, rectangle );
- glcontext.release();
+ glcontext.release();
}
});
@@ -138,24 +140,26 @@ public class TestSWT01GLn extends UITestCase {
GL2 gl = glcontext.getGL().getGL2();
OneTriangle.render( gl, rectangle );
glcanvas.swapBuffers();
- glcontext.release();
+ glcontext.release();
}
});
-
- shell.setText( getClass().getName() );
- shell.setSize( 640, 480 );
- shell.open();
-
- long lStartTime = System.currentTimeMillis();
- long lEndTime = lStartTime + 1000;
- try {
- while( (System.currentTimeMillis() < lEndTime) && !glcanvas.isDisposed() ) {
- if( !display.readAndDispatch() )
- display.sleep();
- }
+
+ shell.setText( getClass().getName() );
+ shell.setSize( 640, 480 );
+ shell.open();
+
+ long lStartTime = System.currentTimeMillis();
+ long lEndTime = lStartTime + duration;
+ try {
+ while( (System.currentTimeMillis() < lEndTime) && !glcanvas.isDisposed() ) {
+ if( !display.readAndDispatch() ) {
+ // blocks on linux .. display.sleep();
+ Thread.sleep(10);
+ }
+ }
}
- catch( Throwable throwable ) {
- throwable.printStackTrace();
+ catch( Throwable throwable ) {
+ throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
}
@@ -168,25 +172,13 @@ public class TestSWT01GLn extends UITestCase {
}
@Test
- public void test02GLMaxFixed() throws InterruptedException {
- GLProfile glprofileMaxFixed = GLProfile.getMaxFixedFunc();
- System.out.println( "GLProfile MaxFixed: " + glprofileMaxFixed );
- try {
- runTestGL( glprofileMaxFixed );
- }
- catch( Throwable throwable ) {
- // FIXME:
- // Stop test and ignore if GL3bc and GL4bc
- // currently this won't work on ATI!
- if( glprofileMaxFixed.equals(GLProfile.GL3bc) || glprofileMaxFixed.equals(GLProfile.GL4bc) ) {
- throwable.printStackTrace();
- Assume.assumeNoException( throwable );
- }
- // else .. serious unexpected exception
- }
+ public void test02GL2() throws InterruptedException {
+ GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+ System.out.println( "GLProfile GL2: " + glprofile );
+ runTestGL( glprofile );
}
public static void main(String args[]) {
org.junit.runner.JUnitCore.main(TestSWT01GLn.class.getName());
}
-} \ No newline at end of file
+}
diff --git a/src/junit/com/jogamp/test/junit/jogl/swt/TestSWTAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java
index 45ab6537f..2ab3c96ad 100644
--- a/src/junit/com/jogamp/test/junit/jogl/swt/TestSWTAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.test.junit.jogl.swt;
+package com.jogamp.opengl.test.junit.jogl.swt;
import java.awt.Frame;
@@ -52,7 +52,7 @@ import org.junit.BeforeClass;
import org.junit.After;
import org.junit.Test;
-import com.jogamp.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.UITestCase;
/**
* Tests that a basic SWT app can open without crashing under different GL profiles. Uses the AWT GL canvas with
@@ -61,7 +61,9 @@ import com.jogamp.test.junit.util.UITestCase;
*/
public class TestSWTAWT01GLn extends UITestCase {
- Display display = null;
+ static final int duration = 250;
+
+ Display display = null;
Shell shell = null;
Composite composite = null;
Frame frame = null;
@@ -77,10 +79,10 @@ public class TestSWTAWT01GLn extends UITestCase {
public void init() {
display = new Display();
Assert.assertNotNull( display );
- shell = new Shell( display );
+ shell = new Shell( display );
Assert.assertNotNull( shell );
- shell.setLayout( new FillLayout() );
- composite = new Composite( shell, SWT.EMBEDDED | SWT.NO_BACKGROUND );
+ shell.setLayout( new FillLayout() );
+ composite = new Composite( shell, SWT.EMBEDDED | SWT.NO_BACKGROUND );
composite.setLayout( new FillLayout() );
Assert.assertNotNull( composite );
frame = SWT_AWT.new_Frame( composite );
@@ -97,65 +99,67 @@ public class TestSWTAWT01GLn extends UITestCase {
frame.setVisible( false );
frame.remove( glcanvas );
frame.dispose();
- composite.dispose();
- shell.dispose();
- display.dispose();
+ composite.dispose();
+ shell.dispose();
+ display.dispose();
}
catch( Throwable throwable ) {
- throwable.printStackTrace();
+ throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
display = null;
shell = null;
- composite = null;
- frame = null;
+ composite = null;
+ frame = null;
glcanvas = null;
}
protected void runTestGL( GLProfile glprofile ) throws InterruptedException {
- GLCapabilities glcapabilities = new GLCapabilities( glprofile );
+ GLCapabilities glcapabilities = new GLCapabilities( glprofile );
glcanvas = new GLCanvas( glcapabilities );
Assert.assertNotNull( glcanvas );
- frame.add( glcanvas );
+ frame.add( glcanvas );
glcanvas.addGLEventListener( new GLEventListener() {
- @Override
- public void init( GLAutoDrawable glautodrawable ) {
- }
+ @Override
+ public void init( GLAutoDrawable glautodrawable ) {
+ }
- @Override
- public void dispose( GLAutoDrawable glautodrawable ) {
- }
+ @Override
+ public void dispose( GLAutoDrawable glautodrawable ) {
+ }
- @Override
- public void display( GLAutoDrawable glautodrawable ) {
+ @Override
+ public void display( GLAutoDrawable glautodrawable ) {
Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getWidth(), glautodrawable.getHeight() );
GL2 gl = glautodrawable.getGL().getGL2();
OneTriangle.render( gl, rectangle );
- }
+ }
- @Override
- public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) {
+ @Override
+ public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) {
Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getWidth(), glautodrawable.getHeight() );
GL2 gl = glautodrawable.getGL().getGL2();
OneTriangle.setup( gl, rectangle );
- }
+ }
});
- shell.setText( getClass().getName() );
- shell.setSize( 640, 480 );
- shell.open();
-
- long lStartTime = System.currentTimeMillis();
- long lEndTime = lStartTime + 1000;
- try {
- while( (System.currentTimeMillis() < lEndTime) && !composite.isDisposed() ) {
- if( !display.readAndDispatch() )
- display.sleep();
- }
+ shell.setText( getClass().getName() );
+ shell.setSize( 640, 480 );
+ shell.open();
+
+ long lStartTime = System.currentTimeMillis();
+ long lEndTime = lStartTime + duration;
+ try {
+ while( (System.currentTimeMillis() < lEndTime) && !composite.isDisposed() ) {
+ if( !display.readAndDispatch() ) {
+ // blocks on linux .. display.sleep();
+ Thread.sleep(10);
+ }
+ }
}
- catch( Throwable throwable ) {
- throwable.printStackTrace();
+ catch( Throwable throwable ) {
+ throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
}
@@ -168,25 +172,13 @@ public class TestSWTAWT01GLn extends UITestCase {
}
@Test
- public void test02GLMaxFixed() throws InterruptedException {
- GLProfile glprofileMaxFixed = GLProfile.getMaxFixedFunc();
- System.out.println( "GLProfile MaxFixed: " + glprofileMaxFixed );
- try {
- runTestGL( glprofileMaxFixed );
- }
- catch( Throwable throwable ) {
- // FIXME:
- // Stop test and ignore if GL3bc and GL4bc
- // currently this won't work on ATI!
- if( glprofileMaxFixed.equals(GLProfile.GL3bc) || glprofileMaxFixed.equals(GLProfile.GL4bc) ) {
- throwable.printStackTrace();
- Assume.assumeNoException( throwable );
- }
- // else .. serious unexpected exception
- }
+ public void test02GL2() throws InterruptedException {
+ GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+ System.out.println( "GLProfile GL2: " + glprofile );
+ runTestGL( glprofile );
}
public static void main(String args[]) {
org.junit.runner.JUnitCore.main( TestSWTAWT01GLn.class.getName() );
}
-} \ No newline at end of file
+}