mirror of https://github.com/axmolengine/axmol.git
Lua tests (#17005)
* fix conflict effect * set index to 1 before running a test case
This commit is contained in:
parent
5823f5792b
commit
de670c1913
|
@ -33,6 +33,20 @@ bool UIScene::init()
|
|||
Size rootSize = _widget->getContentSize();
|
||||
_uiLayer->setPosition(Vec2((screenSize.width - rootSize.width) / 2,
|
||||
(screenSize.height - rootSize.height) / 2));
|
||||
|
||||
// disable these widgets because they are confict with menu itmes created in `TestCase`
|
||||
|
||||
auto restartButton = Helper::seekWidgetByName(_widget, "middle_Button");
|
||||
restartButton->setVisible(false);
|
||||
restartButton->setEnabled(false);
|
||||
|
||||
auto leftButton = Helper::seekWidgetByName(_widget, "left_Button");
|
||||
leftButton->setVisible(false);
|
||||
leftButton->setEnabled(false);
|
||||
|
||||
auto rightButton = Helper::seekWidgetByName(_widget, "right_Button");
|
||||
rightButton->setVisible(false);
|
||||
rightButton->setEnabled(false);
|
||||
|
||||
Layout* root = static_cast<Layout*>(_uiLayer->getChildByTag(81));
|
||||
|
||||
|
|
|
@ -190,6 +190,8 @@ function ActionManagerTestMain()
|
|||
RemoveTest,
|
||||
ResumeTest
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(CrashTest())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -460,6 +460,7 @@ function EaseActionsTest()
|
|||
SpriteEaseBackInOut,
|
||||
SpeedTest
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(SpriteEase())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -290,6 +290,7 @@ function ProgressActionsTest()
|
|||
SpriteProgressBarTintAndFade,
|
||||
SpriteProgressWithSpriteFrame
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(SpriteProgressToRadial())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -1261,6 +1261,7 @@ function ActionsTest()
|
|||
ActionIssue1288_2,
|
||||
ActionIssue1327
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(ActionManual())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -328,6 +328,7 @@ function AssetsManagerExTestMain()
|
|||
AMTestScene2.create,
|
||||
AMTestScene3.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(AMTestScene1.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -257,6 +257,8 @@ function EffectAdvancedTestMain()
|
|||
Effect5,
|
||||
Issue631
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Effect3())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -1147,6 +1147,8 @@ function FastTiledMapTestMain()
|
|||
TMXBug787,
|
||||
-- TMXGIDObjectsTestNew,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(TMXIsoZorder())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -102,6 +102,8 @@ function FontTestMain()
|
|||
createTestLayer,
|
||||
createTestLayer
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(createTestLayer())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -1406,6 +1406,8 @@ function LabelTest()
|
|||
LabelTTFAlignment.create,
|
||||
LabelBMFontBounds.create
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(LabelAtlasTest.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -1734,6 +1734,8 @@ function LabelTestNew()
|
|||
LabelAlignmentTest.create,
|
||||
LabelIssue4428Test.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(LabelFNTColorAndOpacity.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -652,6 +652,8 @@ function LayerTestMain()
|
|||
LayerIgnoreAnchorPointScale,
|
||||
LayerExtendedBlendOpacityTest
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(LayerTestCascadingOpacityA())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -234,6 +234,7 @@ function LightTestMain()
|
|||
{
|
||||
LightTest.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(LightTest.create(), 0)
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -339,6 +339,7 @@ function MaterialSystemTest()
|
|||
Material_Sprite3DTest.create,
|
||||
Material_parsePerformance.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Material_2DEffects.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -173,6 +173,7 @@ function MotionStreakTest()
|
|||
MotionStreakTest2,
|
||||
Issue1358
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(MotionStreakTest1())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -519,6 +519,8 @@ function AudioEngineTest()
|
|||
InvalidAudioFileTest.create,
|
||||
LargeAudioFileTest.create
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(AudioControlTest.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -701,6 +701,7 @@ function CocosNodeTest()
|
|||
NodeNonOpaqueTest,
|
||||
NodeGlobalZValueTest,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(CameraCenterTest())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -151,6 +151,8 @@ function ParallaxTestMain()
|
|||
Parallax1,
|
||||
Parallax2
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Parallax1())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -657,6 +657,7 @@ function Particle3DTest()
|
|||
Particle3DWeaponTrailDemo.create,
|
||||
Particle3DWithSprite3DDemo.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Particle3DExplosionSystemDemo.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -705,6 +705,7 @@ function Physics3DTest()
|
|||
Physics3DCollisionCallbackDemo.create,
|
||||
Physics3DTerrainDemo.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(BasicPhysics3DDemo.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -1738,6 +1738,7 @@ function PhysicsTest()
|
|||
PhysicsTransformTest,
|
||||
PhysicsIssue9959
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Helper.createFunctionTable[1]())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -609,6 +609,8 @@ function RenderTextureTestMain()
|
|||
-- RenderTextureTargetNode,
|
||||
-- SpriteRenderTextureBug
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(RenderTextureSave())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -670,6 +670,7 @@ function Scene3DTestMain()
|
|||
{
|
||||
Scene3DTest.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Scene3DTest.create())
|
||||
local menu = CreateBackMenuItem()
|
||||
|
|
|
@ -141,6 +141,7 @@ function SpineTestMain()
|
|||
SpineTestLayerNormal.create,
|
||||
SpineTestLayerFFD.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(SpineTestLayerNormal.create(), 0)
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -1369,6 +1369,7 @@ function Sprite3DTest()
|
|||
Sprite3DNormalMappingTest.create,
|
||||
Sprite3DMaterialTest.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Sprite3DBasicTest.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -567,6 +567,7 @@ function SpritePolygonTest()
|
|||
SpritePolygonPerformanceTestDynamic.create,
|
||||
SpritePerformanceTestDynamic.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(SpritePolygonTest1.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -1580,6 +1580,7 @@ function SpriteTest()
|
|||
SpriteBatchNodeOffsetAnchorRotationalSkewScale.create,
|
||||
SpriteOffsetAnchorFlip.create
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(Sprite1.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -332,6 +332,7 @@ function TerrainTest()
|
|||
TerrainSimple.create,
|
||||
TerrainWalkThru.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(TerrainSimple.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
|
|
|
@ -31,6 +31,8 @@ function TextInputTestMain()
|
|||
Helper.createFunctionTable = {
|
||||
TextInput.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(TextInput.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -1449,6 +1449,8 @@ function Texture2dTestMain()
|
|||
TextureDrawAtPoint,
|
||||
TextureDrawInRect
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(TextureMemoryAlloc())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -1236,6 +1236,8 @@ function TileMapTestMain()
|
|||
TMXBug987,
|
||||
TMXBug787
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(TileMapTest())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -57,6 +57,8 @@ function VibrateTestMain()
|
|||
Helper.createFunctionTable = {
|
||||
VibrateControlTest.create
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(VibrateControlTest.create())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -135,11 +135,12 @@ end
|
|||
|
||||
|
||||
function VideoPlayerTestMain()
|
||||
Helper.index = 1
|
||||
local scene = cc.Scene:create()
|
||||
Helper.createFunctionTable = {
|
||||
VideoPlayerTest
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(VideoPlayerTest())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
|
@ -121,6 +121,7 @@ function WebViewTestMain()
|
|||
{
|
||||
WebViewTest.create,
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
local scene = cc.Scene:create()
|
||||
scene:addChild(WebViewTest.create())
|
||||
|
|
|
@ -117,11 +117,12 @@ end
|
|||
|
||||
function ZwoptexTestMain()
|
||||
cclog("ZwoptexTestMain")
|
||||
Helper.index = 1
|
||||
local scene = cc.Scene:create()
|
||||
Helper.createFunctionTable = {
|
||||
ZwoptexGenericTest
|
||||
}
|
||||
Helper.index = 1
|
||||
|
||||
scene:addChild(ZwoptexGenericTest())
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
|
|
Loading…
Reference in New Issue