From 1a6da1537cc7681eb1e5fe3abb26e53b3423e742 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 10 Oct 2012 15:09:35 +0200 Subject: UITestCase: Only print each display/reshape in verbose mode --- src/test/com/jogamp/opengl/test/junit/util/UITestCase.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/test/com/jogamp') diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java index bd9cd0966..ccfd3867e 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java +++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java @@ -214,6 +214,7 @@ public abstract class UITestCase { private final GLReadBufferUtil screenshot; private volatile boolean makeShot = false; private volatile boolean makeShotAlways = false; + private volatile boolean verbose = false; private volatile int displayCount=0; private volatile int reshapeCount=0; public SnapshotGLEventListener(GLReadBufferUtil screenshot) { @@ -230,7 +231,9 @@ public abstract class UITestCase { public void display(GLAutoDrawable drawable) { final GL gl = drawable.getGL(); final boolean _makeShot = makeShot || makeShotAlways; - System.err.println(Thread.currentThread().getName()+": ** display: "+displayCount+": "+drawable.getWidth()+"x"+drawable.getHeight()+", makeShot "+_makeShot); + if(verbose) { + System.err.println(Thread.currentThread().getName()+": ** display: "+displayCount+": "+drawable.getWidth()+"x"+drawable.getHeight()+", makeShot "+_makeShot); + } if(_makeShot) { makeShot=false; snapshot(displayCount, null, gl, screenshot, TextureIO.PNG, null); @@ -238,7 +241,9 @@ public abstract class UITestCase { displayCount++; } public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { - System.err.println(Thread.currentThread().getName()+": ** reshape: "+reshapeCount+": "+width+"x"+height+" - "+drawable.getWidth()+"x"+drawable.getHeight()); + if(verbose) { + System.err.println(Thread.currentThread().getName()+": ** reshape: "+reshapeCount+": "+width+"x"+height+" - "+drawable.getWidth()+"x"+drawable.getHeight()); + } reshapeCount++; } public void setMakeSnapshot() { @@ -247,6 +252,9 @@ public abstract class UITestCase { public void setMakeSnapshotAlways(boolean v) { makeShotAlways=v; } + public void setVerbose(boolean v) { + verbose=v; + } }; } -- cgit v1.2.3