OSDN Git Service

merged nate's stuff...
[mikumikustudio/libgdx-mikumikustudio.git] / tests / gdx-tests / src / com / badlogic / gdx / tests / utils / GdxTests.java
1 /*******************************************************************************\r
2  * Copyright 2011 See AUTHORS file.\r
3  * \r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  * \r
8  *   http://www.apache.org/licenses/LICENSE-2.0\r
9  * \r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  ******************************************************************************/\r
16 /*\r
17  * Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)\r
18  * \r
19  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the\r
20  * License. You may obtain a copy of the License at\r
21  * \r
22  * http://www.apache.org/licenses/LICENSE-2.0\r
23  * \r
24  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"\r
25  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language\r
26  * governing permissions and limitations under the License.\r
27  */\r
28 \r
29 package com.badlogic.gdx.tests.utils;\r
30 \r
31 import java.util.ArrayList;\r
32 import java.util.Arrays;\r
33 import java.util.Collections;\r
34 import java.util.List;\r
35 \r
36 import com.badlogic.gdx.tests.*;\r
37 import com.badlogic.gdx.tests.bench.TiledMapBench;\r
38 import com.badlogic.gdx.tests.examples.MoveSpriteExample;\r
39 import com.badlogic.gdx.tests.g3d.Animation3DTest;\r
40 import com.badlogic.gdx.tests.g3d.Basic3DSceneTest;\r
41 import com.badlogic.gdx.tests.g3d.Basic3DTest;\r
42 import com.badlogic.gdx.tests.g3d.FogTest;\r
43 import com.badlogic.gdx.tests.g3d.MaterialTest;\r
44 import com.badlogic.gdx.tests.g3d.ModelTest;\r
45 import com.badlogic.gdx.tests.g3d.ShaderCollectionTest;\r
46 import com.badlogic.gdx.tests.g3d.ShaderTest;\r
47 import com.badlogic.gdx.tests.g3d.SkeletonTest;\r
48 import com.badlogic.gdx.tests.gles2.HelloTriangle;\r
49 import com.badlogic.gdx.tests.gles2.SimpleVertexShader;\r
50 import com.badlogic.gdx.tests.net.NetAPITest;\r
51 import com.badlogic.gdx.tests.superkoalio.SuperKoalio;\r
52 \r
53 /** List of GdxTest classes. To be used by the test launchers. If you write your own test, add it in here!\r
54  * \r
55  * @author badlogicgames@gmail.com */\r
56 public class GdxTests {\r
57         public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList(
58                 // @off\r
59                 AccelerometerTest.class,\r
60                 ActionSequenceTest.class,\r
61                 ActionTest.class,\r
62                 AlphaTest.class,\r
63                 Animation3DTest.class,\r
64                 AnimationTest.class,\r
65                 AssetManagerTest.class,\r
66                 AtlasIssueTest.class,\r
67                 AudioDeviceTest.class,\r
68                 AudioRecorderTest.class,\r
69                 Basic3DSceneTest.class,\r
70                 Basic3DTest.class,\r
71                 BitmapFontAlignmentTest.class,\r
72                 BitmapFontDistanceFieldTest.class,\r
73                 BitmapFontFlipTest.class,\r
74                 BitmapFontMetricsTest.class,\r
75                 BitmapFontTest.class,\r
76                 BlitTest.class,\r
77                 BobTest.class,\r
78                 Box2DTest.class,\r
79                 Box2DTestCollection.class,\r
80                 Bresenham2Test.class,\r
81                 BufferUtilsTest.class,\r
82                 BulletTestCollection.class,\r
83                 CompassTest.class,\r
84                 ComplexActionTest.class,\r
85                 CullTest.class,\r
86                 DelaunayTriangulatorTest.class,\r
87                 DeltaTimeTest.class,\r
88                 DirtyRenderingTest.class,\r
89                 DragAndDropTest.class,\r
90                 ETC1Test.class,\r
91                 EarClippingTriangulatorTest.class,\r
92                 EdgeDetectionTest.class,\r
93                 ExitTest.class,\r
94                 ExternalMusicTest.class,\r
95                 FilesTest.class,\r
96                 FilterPerformanceTest.class,\r
97                 FloatTest.class,\r
98                 FloatTextureTest.class,\r
99                 FogTest.class,\r
100                 FrameBufferTest.class,\r
101                 FramebufferToTextureTest.class,\r
102                 FrustumTest.class,\r
103                 FullscreenTest.class,\r
104                 GamepadTest.class,\r
105                 Gdx2DTest.class,\r
106                 GestureDetectorTest.class,\r
107                 GroupCullingTest.class,\r
108                 GroupFadeTest.class,\r
109                 GroupTest.class,\r
110                 HelloTriangle.class,\r
111                 HexagonalTiledMapTest.class,\r
112                 ImageScaleTest.class,\r
113                 ImageTest.class,\r
114                 ImmediateModeRendererAlphaTest.class,\r
115                 ImmediateModeRendererTest.class,\r
116                 IndexBufferObjectClassTest.class,\r
117                 IndexBufferObjectShaderTest.class,\r
118                 InputTest.class,\r
119                 IntegerBitmapFontTest.class,\r
120                 InterpolationTest.class,\r
121                 InverseKinematicsTest.class,\r
122                 IsometricTileTest.class,\r
123                 KinematicBodyTest.class,\r
124                 LabelScaleTest.class,\r
125                 LabelTest.class,\r
126                 LetterBoxTest1.class,\r
127                 LetterBoxTest2.class,\r
128                 LetterBoxTest3.class,\r
129                 LifeCycleTest.class,\r
130                 LineDrawingTest.class,\r
131                 ManagedTest.class,\r
132                 ManualBindTest.class,\r
133                 MaterialTest.class,\r
134                 MatrixJNITest.class,\r
135                 MeshMultitextureTest.class,\r
136                 MeshShaderTest.class,\r
137                 MeshTest.class,\r
138                 MipMapTest.class,\r
139                 ModelTest.class,\r
140                 MoveSpriteExample.class,\r
141                 MultitouchTest.class,\r
142                 MusicTest.class,\r
143                 MyFirstTriangle.class,\r
144                 NetAPITest.class,\r
145                 NinePatchTest.class,\r
146                 ObjTest.class,\r
147                 OnscreenKeyboardTest.class,\r
148                 OrthoCamBorderTest.class,\r
149                 ParallaxTest.class,\r
150                 ParticleEmitterTest.class,\r
151                 PathTest.class,\r
152                 PickingTest.class,\r
153                 PixelsPerInchTest.class,\r
154                 PixmapBlendingTest.class,\r
155                 PixmapPackerTest.class,\r
156                 PixmapTest.class,\r
157                 PolygonRegionTest.class,\r
158                 PolygonSpriteTest.class,\r
159                 Pong.class,\r
160                 PreferencesTest.class,\r
161                 ProjectTest.class,\r
162                 ProjectiveTextureTest.class,\r
163                 RemoteTest.class,\r
164                 RotationTest.class,\r
165                 RunnablePostTest.class,\r
166                 Scene2dTest.class,\r
167                 ScreenCaptureTest.class,\r
168                 ScrollPane2Test.class,\r
169                 ScrollPaneScrollBarsTest.class,\r
170                 ScrollPaneTest.class,\r
171                 SelectTest.class,\r
172                 ShaderCollectionTest.class,\r
173                 ShaderMultitextureTest.class,\r
174                 ShaderTest.class,\r
175                 ShadowMappingTest.class,\r
176                 ShapeRendererTest.class,\r
177                 SimpleAnimationTest.class,\r
178                 SimpleDecalTest.class,\r
179                 SimpleStageCullingTest.class,\r
180                 SimpleVertexShader.class,\r
181                 SkeletonTest.class,\r
182                 SoftKeyboardTest.class,\r
183                 SortedSpriteTest.class,\r
184                 SoundTest.class,\r
185                 SpriteBatchRotationTest.class,\r
186                 SpriteBatchShaderTest.class,\r
187                 SpriteBatchTest.class,\r
188                 SpriteCacheOffsetTest.class,\r
189                 SpriteCacheTest.class,\r
190                 SpritePerformanceTest.class,\r
191                 SpritePerformanceTest2.class,\r
192                 StagePerformanceTest.class,\r
193                 StageTest.class,\r
194                 SuperKoalio.class,\r
195                 TableLayoutTest.class,\r
196                 TableTest.class,\r
197                 TerrainTest.class,\r
198                 TextButtonTest.class,\r
199                 TextButtonTestGL2.class,\r
200                 TextInputDialogTest.class,\r
201                 TextureAtlasTest.class,\r
202                 TextureBindTest.class,\r
203                 TextureDataTest.class,\r
204                 TextureDownloadTest.class,\r
205                 TextureFormatTest.class,\r
206                 TextureRenderTest.class,\r
207                 TideMapAssetManagerTest.class,\r
208                 TideMapDirectLoaderTest.class,\r
209                 TileTest.class,\r
210                 TiledMapAssetManagerTest.class,\r
211                 TiledMapBench.class,\r
212                 TimerTest.class,\r
213                 TouchpadTest.class,\r
214                 TreeTest.class,\r
215                 UISimpleTest.class,\r
216                 UITest.class,\r
217                 VBOVATest.class,\r
218                 Vector2dTest.class,\r
219                 VertexArrayClassTest.class,\r
220                 VertexArrayTest.class,\r
221                 VertexBufferObjectClassTest.class,\r
222                 VertexBufferObjectShaderTest.class,\r
223                 VertexBufferObjectTest.class,\r
224                 VibratorTest.class,\r
225                 WaterRipples.class,\r
226                 YDownTest.class\r
227                 // @on\r
228 \r
229                 // SoundTouchTest.class, Mpg123Test.class, WavTest.class, FreeTypeTest.class,\r
230                 // InternationalFontsTest.class, VorbisTest.class\r
231                 ));\r
232 \r
233         public static List<String> getNames () {\r
234                 List<String> names = new ArrayList<String>(tests.size());\r
235                 for (Class clazz : tests)\r
236                         names.add(clazz.getSimpleName());\r
237                 Collections.sort(names);\r
238                 return names;\r
239         }\r
240 \r
241         private static Class<? extends GdxTest> forName (String name) {\r
242                 for (Class clazz : tests)\r
243                         if (clazz.getSimpleName().equals(name)) return clazz;\r
244                 return null;\r
245         }\r
246 \r
247         public static GdxTest newTest (String testName) {\r
248                 try {\r
249                         return forName(testName).newInstance();\r
250                 } catch (InstantiationException e) {\r
251                         e.printStackTrace();\r
252                 } catch (IllegalAccessException e) {\r
253                         e.printStackTrace();\r
254                 }\r
255                 return null;\r
256         }\r
257 }\r