OSDN Git Service

add buttons to test for fade and scrollbarsOnTop, used eclipse code formatter, exclud...
[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(\r
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                 IsoCamTest.class,\r
123                 IsometricTileTest.class,\r
124                 KinematicBodyTest.class,\r
125                 LabelScaleTest.class,\r
126                 LabelTest.class,\r
127                 LetterBoxTest1.class,\r
128                 LetterBoxTest2.class,\r
129                 LetterBoxTest3.class,\r
130                 LifeCycleTest.class,\r
131                 LineDrawingTest.class,\r
132                 ManagedTest.class,\r
133                 ManualBindTest.class,\r
134                 MaterialTest.class,\r
135                 MatrixJNITest.class,\r
136                 MeshMultitextureTest.class,\r
137                 MeshShaderTest.class,\r
138                 MeshTest.class,\r
139                 MipMapTest.class,\r
140                 ModelTest.class,\r
141                 MoveSpriteExample.class,\r
142                 MultitouchTest.class,\r
143                 MusicTest.class,\r
144                 MyFirstTriangle.class,\r
145                 NetAPITest.class,\r
146                 NinePatchTest.class,\r
147                 ObjTest.class,\r
148                 OnscreenKeyboardTest.class,\r
149                 OrthoCamBorderTest.class,\r
150                 ParallaxTest.class,\r
151                 ParticleEmitterTest.class,\r
152                 PathTest.class,\r
153                 PickingTest.class,\r
154                 PixelsPerInchTest.class,\r
155                 PixmapBlendingTest.class,\r
156                 PixmapPackerTest.class,\r
157                 PixmapTest.class,\r
158                 PolygonRegionTest.class,\r
159                 PolygonSpriteTest.class,\r
160                 Pong.class,\r
161                 PreferencesTest.class,\r
162                 ProjectTest.class,\r
163                 ProjectiveTextureTest.class,\r
164                 RemoteTest.class,\r
165                 RotationTest.class,\r
166                 RunnablePostTest.class,\r
167                 Scene2dTest.class,\r
168                 ScreenCaptureTest.class,\r
169                 ScrollPane2Test.class,\r
170                 ScrollPaneScrollBarsTest.class,\r
171                 ScrollPaneTest.class,\r
172                 SelectTest.class,\r
173                 ShaderCollectionTest.class,\r
174                 ShaderMultitextureTest.class,\r
175                 ShaderTest.class,\r
176                 ShadowMappingTest.class,\r
177                 ShapeRendererTest.class,\r
178                 SimpleAnimationTest.class,\r
179                 SimpleDecalTest.class,\r
180                 SimpleStageCullingTest.class,\r
181                 SimpleVertexShader.class,\r
182                 SkeletonTest.class,\r
183                 SoftKeyboardTest.class,\r
184                 SortedSpriteTest.class,\r
185                 SoundTest.class,\r
186                 SpriteBatchRotationTest.class,\r
187                 SpriteBatchShaderTest.class,\r
188                 SpriteBatchTest.class,\r
189                 SpriteCacheOffsetTest.class,\r
190                 SpriteCacheTest.class,\r
191                 SpritePerformanceTest.class,\r
192                 SpritePerformanceTest2.class,\r
193                 StagePerformanceTest.class,\r
194                 StageTest.class,\r
195                 SuperKoalio.class,\r
196                 TableLayoutTest.class,\r
197                 TableTest.class,\r
198                 TerrainTest.class,\r
199                 TextButtonTest.class,\r
200                 TextButtonTestGL2.class,\r
201                 TextInputDialogTest.class,\r
202                 TextureAtlasTest.class,\r
203                 TextureBindTest.class,\r
204                 TextureDataTest.class,\r
205                 TextureDownloadTest.class,\r
206                 TextureFormatTest.class,\r
207                 TextureRenderTest.class,\r
208                 TideMapAssetManagerTest.class,\r
209                 TideMapDirectLoaderTest.class,\r
210                 TileTest.class,\r
211                 TiledMapAssetManagerTest.class,\r
212                 TiledMapBench.class,\r
213                 TimerTest.class,\r
214                 TouchpadTest.class,\r
215                 TreeTest.class,\r
216                 UISimpleTest.class,\r
217                 UITest.class,\r
218                 VBOVATest.class,\r
219                 Vector2dTest.class,\r
220                 VertexArrayClassTest.class,\r
221                 VertexArrayTest.class,\r
222                 VertexBufferObjectClassTest.class,\r
223                 VertexBufferObjectShaderTest.class,\r
224                 VertexBufferObjectTest.class,\r
225                 VibratorTest.class,\r
226                 WaterRipples.class,\r
227                 YDownTest.class\r
228                 // @on\r
229 \r
230                 // SoundTouchTest.class, Mpg123Test.class, WavTest.class, FreeTypeTest.class,\r
231                 // InternationalFontsTest.class, VorbisTest.class\r
232                 ));\r
233 \r
234         public static List<String> getNames () {\r
235                 List<String> names = new ArrayList<String>(tests.size());\r
236                 for (Class clazz : tests)\r
237                         names.add(clazz.getSimpleName());\r
238                 Collections.sort(names);\r
239                 return names;\r
240         }\r
241 \r
242         private static Class<? extends GdxTest> forName (String name) {\r
243                 for (Class clazz : tests)\r
244                         if (clazz.getSimpleName().equals(name)) return clazz;\r
245                 return null;\r
246         }\r
247 \r
248         public static GdxTest newTest (String testName) {\r
249                 try {\r
250                         return forName(testName).newInstance();\r
251                 } catch (InstantiationException e) {\r
252                         e.printStackTrace();\r
253                 } catch (IllegalAccessException e) {\r
254                         e.printStackTrace();\r
255                 }\r
256                 return null;\r
257         }\r
258 }\r