cocos2d / cocos2d-js-tests

cocos2d JavaScript test cases and games.
187 stars 222 forks source link

Fix the single page version of cocos2d-js-tests til the point that PerformanceSpriteTest can be run. #186

Closed kennyluck closed 11 years ago

kennyluck commented 11 years ago

This is accompanied by a pull request to cocos2d-html5.

I don't claim to know much about the mechanism of the single page version (for example, I have no idea how you are supposed to use the compile_test target given that it doesn't include cocos2d. A pointer to the documentation is much appreciated!), but running ant compile_test_advanced very soon gave me

[jscomp] ERROR - Cannot read: /Users/kennyluck/Projects/cocos2d-html5/samples/tests/S9SpriteTest/S9SpriteTest.js [jscomp] /Users/kennyluck/Projects/cocos2d-html5/samples/tests/tests_resources-html5.js:279: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.

and this patch fixes this.

Also, this patch doesn't fix all tests (e.g. PerformanceParticleTest doesn't work), but I probably don't have time for this before I prepare the tests for our CCClass.js submission.

This change syncs the file list to appFiles in tests-boot-html5.js. Not sure this is the right thing to do.

(Increasing Closure Compiler's warning level seems like a fun thing to do too, but I'll leave that to the future.)