| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 | 2 |
| 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
| 5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 /** The entry point for the analyzer. */ | 7 /** The entry point for the analyzer. */ |
| 8 library analyzer; | 8 library analyzer; |
| 9 | 9 |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 */ | 73 */ |
| 74 static ErrorSeverity runAsBatch(List<String> sharedArgs, BatchRunnerHandler ha
ndler) { | 74 static ErrorSeverity runAsBatch(List<String> sharedArgs, BatchRunnerHandler ha
ndler) { |
| 75 stdout.writeln('>>> BATCH START'); | 75 stdout.writeln('>>> BATCH START'); |
| 76 Stopwatch stopwatch = new Stopwatch(); | 76 Stopwatch stopwatch = new Stopwatch(); |
| 77 stopwatch.start(); | 77 stopwatch.start(); |
| 78 int testsFailed = 0; | 78 int testsFailed = 0; |
| 79 int totalTests = 0; | 79 int totalTests = 0; |
| 80 ErrorSeverity batchResult = ErrorSeverity.NONE; | 80 ErrorSeverity batchResult = ErrorSeverity.NONE; |
| 81 // read line from stdin | 81 // read line from stdin |
| 82 Stream cmdLine = stdin | 82 Stream cmdLine = stdin |
| 83 .transform(new StringDecoder()) | 83 .transform(UTF8.decoder) |
| 84 .transform(new LineSplitter()); | 84 .transform(new LineSplitter()); |
| 85 var subscription = cmdLine.listen((String line) { | 85 var subscription = cmdLine.listen((String line) { |
| 86 // may be finish | 86 // may be finish |
| 87 if (line.isEmpty) { | 87 if (line.isEmpty) { |
| 88 var time = stopwatch.elapsedMilliseconds; | 88 var time = stopwatch.elapsedMilliseconds; |
| 89 stdout.writeln('>>> BATCH END (${totalTests - testsFailed}/$totalTests)
${time}ms'); | 89 stdout.writeln('>>> BATCH END (${totalTests - testsFailed}/$totalTests)
${time}ms'); |
| 90 exit(batchResult.ordinal); | 90 exit(batchResult.ordinal); |
| 91 } | 91 } |
| 92 // prepare aruments | 92 // prepare aruments |
| 93 var args; | 93 var args; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 116 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); | 116 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); |
| 117 } catch (e, stackTrace) { | 117 } catch (e, stackTrace) { |
| 118 stderr.writeln(e); | 118 stderr.writeln(e); |
| 119 stderr.writeln(stackTrace); | 119 stderr.writeln(stackTrace); |
| 120 stderr.writeln('>>> EOF STDERR'); | 120 stderr.writeln('>>> EOF STDERR'); |
| 121 stdout.writeln('>>> TEST CRASH'); | 121 stdout.writeln('>>> TEST CRASH'); |
| 122 } | 122 } |
| 123 }); | 123 }); |
| 124 } | 124 } |
| 125 } | 125 } |
| OLD | NEW |