source: trunk/fl5/test/PlayerTestLauncher.as @ 280

Revision 280, 1.2 KB checked in by zach, 4 years ago (diff)
  • Added AIR SDK to build.properties
  • Added FlexUnit GUI (and windowless launch option)
  • Made filepath and file output optional
Line 
1package {
2                import org.flexunit.flexui.TestRunnerBase;
3                import org.flexunit.listeners.UIListener;
4                import org.flexunit.runner.FlexUnitCore;
5                import flash.desktop.NativeApplication;
6
7       
8        /**
9         * The test launcher sets up the FlexUnit enviroment for testing, adds the test suites, and
10         * creates the ResultPrinter.
11         *
12         * @author zach@longtailvideo.com
13         * @date 2009-08-18
14         */
15        public class PlayerTestLauncher extends TestRunnerBase {
16                private var core:FlexUnitCore;                 
17                private var visualRunner:TestRunnerBase;
18
19                public function PlayerTestLauncher(outputPath:String=null, visualRunner:TestRunnerBase=null) {
20                       
21                        var core:FlexUnitCore = new FlexUnitCore();
22                        if (visualRunner){
23                                this.visualRunner = visualRunner;
24                                core.addListener(new UIListener(visualRunner));
25                        }
26                        core.addListener(new PlayerTestRunListener(this, new PlayerTestResultPrinter(outputPath)));
27                        core.run(PlayerTestSuite);
28                }
29               
30                /**
31                 * Terminates the Air Debug Launcher, with an appropriate status code, when testing is done.
32                 * @param status The appropriate exit code.
33                 */
34                public function complete(status:Number):void {
35                        if (!visualRunner){
36                                visualRunner = null;
37                                NativeApplication.nativeApplication.exit(status);
38                        }
39                }
40        }
41}
Note: See TracBrowser for help on using the repository browser.