+++ /dev/null
-\r
-package com.badlogic.gdx.tests;\r
-\r
-import com.badlogic.gdx.ApplicationListener;\r
-import com.badlogic.gdx.Gdx;\r
-import com.badlogic.gdx.InputListener;\r
-import com.badlogic.gdx.tests.utils.GdxTest;\r
-import com.badlogic.gdx.utils.PauseableThread;\r
-\r
-public class DualThreadTest implements ApplicationListener, GdxTest, InputListener {\r
- PauseableThread gameLoop;\r
-\r
- @Override public void surfaceCreated () {\r
- Gdx.input.addInputListener(this);\r
-\r
- if (gameLoop == null) {\r
- gameLoop = new PauseableThread(new Runnable() {\r
-\r
- @Override public void run () {\r
- System.out.println("working my ass off! " + System.nanoTime());\r
- }\r
-\r
- });\r
- gameLoop.start();\r
- }\r
- }\r
-\r
- @Override public void destroy () {\r
- gameLoop.stopThread();\r
- }\r
-\r
- @Override public void pause () {\r
- gameLoop.onPause();\r
- }\r
-\r
- @Override public void resume () {\r
- gameLoop.onResume();\r
- }\r
-\r
- @Override public void dispose () {\r
-\r
- }\r
-\r
- @Override public void render () {\r
-\r
- }\r
-\r
- @Override public void surfaceChanged (int width, int height) {\r
-\r
- }\r
-\r
- @Override public boolean keyDown (int keycode) {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-\r
- @Override public boolean keyTyped (char character) {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-\r
- @Override public boolean keyUp (int keycode) {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-\r
- @Override public boolean touchDown (int x, int y, int pointer) {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-\r
- @Override public boolean touchDragged (int x, int y, int pointer) {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-\r
- @Override public boolean touchUp (int x, int y, int pointer) {\r
- if (gameLoop.isPaused())\r
- gameLoop.onResume();\r
- else\r
- gameLoop.onPause();\r
- return false;\r
- }\r
-\r
- @Override public boolean needsGL20 () {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-}\r
+++ /dev/null
-\r
-package com.badlogic.gdx.tests.utils;\r
-\r
-import java.io.File;\r
-import java.net.URL;\r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-import com.badlogic.gdx.GdxRuntimeException;\r
-\r
-public class GdxTestEnumerator {\r
-\r
- public static String[] getTestNames () {\r
- String packageDirectory = "/com/badlogic/gdx/tests/";\r
- String packageName = "com.badlogic.gdx.tests.";\r
- \r
- URL url = GdxTestEnumerator.class.getResource(packageDirectory);\r
- File file = new File(url.getFile());\r
- List<String> tests = new ArrayList<String>();\r
-\r
- if (file.exists()) {\r
- String[] files = file.list();\r
- for (String name : files) {\r
- if (name.endsWith(".class") && !name.contains("$")) {\r
- name = name.replace(".class", "");\r
-\r
- try {\r
- Class clazz = Class.forName(packageName + name);\r
- Class[] interfaces = clazz.getInterfaces();\r
- for (Class interf : interfaces) {\r
- if (interf.equals(GdxTest.class)) tests.add(name);\r
- }\r
-\r
- } catch (Throwable t) {\r
- // empty catch, yay\r
- }\r
- }\r
- }\r
-\r
- return tests.toArray(new String[tests.size()]);\r
- }\r
-\r
- return null;\r
- }\r
-\r
- public static GdxTest newTest (String name) {\r
- try {\r
- Class clazz = Class.forName("com.badlogic.gdx.tests." + name);\r
- return (GdxTest)clazz.newInstance();\r
- } catch (Throwable t) {\r
- throw new GdxRuntimeException( "couldn't load test");\r
- }\r
- }\r
-\r
- public static void main (String[] argv) {\r
- String[] tests = GdxTestEnumerator.getTestNames();\r
-\r
- System.out.println(tests.length + " tests");\r
- System.out.println(Arrays.toString(tests));\r
- }\r
-}\r
--- /dev/null
+package com.badlogic.gdx.tests.utils;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import com.badlogic.gdx.tests.AlphaTest;\r
+import com.badlogic.gdx.tests.AudioDeviceTest;\r
+import com.badlogic.gdx.tests.AudioRecorderTest;\r
+import com.badlogic.gdx.tests.BitmapFontFlipTest;\r
+import com.badlogic.gdx.tests.BitmapFontTest;\r
+import com.badlogic.gdx.tests.Box2DTest;\r
+import com.badlogic.gdx.tests.Box2DTestCollection;\r
+import com.badlogic.gdx.tests.FillrateTest;\r
+import com.badlogic.gdx.tests.FixedPointMeshTest;\r
+import com.badlogic.gdx.tests.FixedPointTest;\r
+import com.badlogic.gdx.tests.FloatTest;\r
+import com.badlogic.gdx.tests.FrameBufferTest;\r
+import com.badlogic.gdx.tests.ImmediateModeRendererTest;\r
+import com.badlogic.gdx.tests.InputTest;\r
+import com.badlogic.gdx.tests.LifeCycleTest;\r
+import com.badlogic.gdx.tests.MD5Test;\r
+import com.badlogic.gdx.tests.ManagedTest;\r
+import com.badlogic.gdx.tests.MeshMultitextureTest;\r
+import com.badlogic.gdx.tests.MeshShaderTest;\r
+import com.badlogic.gdx.tests.MeshTest;\r
+import com.badlogic.gdx.tests.Mpg123Test;\r
+import com.badlogic.gdx.tests.MultitouchTest;\r
+import com.badlogic.gdx.tests.ObjTest;\r
+import com.badlogic.gdx.tests.PerformanceTest;\r
+import com.badlogic.gdx.tests.Pong;\r
+import com.badlogic.gdx.tests.SimpleTest;\r
+import com.badlogic.gdx.tests.SoundTest;\r
+import com.badlogic.gdx.tests.SpriteBatchRotationTest;\r
+import com.badlogic.gdx.tests.SpriteBatchShaderTest;\r
+import com.badlogic.gdx.tests.SpriteBatchTest;\r
+import com.badlogic.gdx.tests.StageTest;\r
+import com.badlogic.gdx.tests.TerrainTest;\r
+import com.badlogic.gdx.tests.TextTest;\r
+import com.badlogic.gdx.tests.TextureRenderTest;\r
+import com.badlogic.gdx.tests.UITest;\r
+import com.badlogic.gdx.tests.VertexArrayTest;\r
+import com.badlogic.gdx.tests.VertexBufferObjectTest;\r
+import com.badlogic.gdx.tests.VorbisTest;\r
+import com.badlogic.gdx.tests.WaterRipples;\r
+\r
+/**\r
+ * List of GdxTest classes. To be used by the test launchers.\r
+ * If you write your own test, add it in here!\r
+ * \r
+ * @author badlogicgames@gmail.com\r
+ *\r
+ */\r
+public class GdxTests \r
+{\r
+ public static final Class[] tests = {\r
+ AlphaTest.class,\r
+ AudioDeviceTest.class,\r
+ AudioRecorderTest.class,\r
+ BitmapFontFlipTest.class,\r
+ BitmapFontTest.class,\r
+ Box2DTest.class,\r
+ Box2DTestCollection.class,\r
+ FillrateTest.class,\r
+ FixedPointMeshTest.class,\r
+ FixedPointTest.class,\r
+ FloatTest.class,\r
+ FrameBufferTest.class,\r
+ ImmediateModeRendererTest.class,\r
+ InputTest.class,\r
+ LifeCycleTest.class,\r
+ ManagedTest.class,\r
+ MD5Test.class,\r
+ MeshMultitextureTest.class,\r
+ MeshShaderTest.class,\r
+ MeshTest.class,\r
+ Mpg123Test.class,\r
+ MultitouchTest.class,\r
+ ObjTest.class,\r
+ PerformanceTest.class,\r
+ Pong.class,\r
+ SimpleTest.class,\r
+ SoundTest.class,\r
+ SpriteBatchRotationTest.class,\r
+ SpriteBatchShaderTest.class,\r
+ SpriteBatchTest.class,\r
+ StageTest.class,\r
+ TerrainTest.class,\r
+ TextTest.class,\r
+ TextureRenderTest.class,\r
+ UITest.class,\r
+ VertexArrayTest.class,\r
+ VertexBufferObjectTest.class,\r
+ VorbisTest.class,\r
+ WaterRipples.class\r
+ };\r
+ \r
+ public static String[] getNames () {\r
+ List<String> names = new ArrayList<String>( );\r
+ for( Class clazz: tests )\r
+ names.add(clazz.getSimpleName());\r
+ return names.toArray(new String[names.size()]);\r
+ }\r
+\r
+ public static GdxTest newTest (String testName) {\r
+ try {\r
+ Class clazz = Class.forName("com.badlogic.gdx.tests." + testName);\r
+ return (GdxTest)clazz.newInstance();\r
+ }\r
+ catch( Exception ex ) {\r
+ return null;\r
+ } \r
+ }\r
+}\r