| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 stdout.writeln('>>> BATCH START'); | 100 stdout.writeln('>>> BATCH START'); |
| 101 Stopwatch stopwatch = new Stopwatch(); | 101 Stopwatch stopwatch = new Stopwatch(); |
| 102 stopwatch.start(); | 102 stopwatch.start(); |
| 103 int testsFailed = 0; | 103 int testsFailed = 0; |
| 104 int totalTests = 0; | 104 int totalTests = 0; |
| 105 ErrorSeverity batchResult = ErrorSeverity.NONE; | 105 ErrorSeverity batchResult = ErrorSeverity.NONE; |
| 106 // read line from stdin | 106 // read line from stdin |
| 107 Stream cmdLine = stdin | 107 Stream cmdLine = stdin |
| 108 .transform(UTF8.decoder) | 108 .transform(UTF8.decoder) |
| 109 .transform(new LineSplitter()); | 109 .transform(new LineSplitter()); |
| 110 var subscription = cmdLine.listen((String line) { | 110 cmdLine.listen((String line) { |
| 111 // may be finish | 111 // may be finish |
| 112 if (line.isEmpty) { | 112 if (line.isEmpty) { |
| 113 var time = stopwatch.elapsedMilliseconds; | 113 var time = stopwatch.elapsedMilliseconds; |
| 114 stdout.writeln('>>> BATCH END (${totalTests - testsFailed}/$totalTests)
${time}ms'); | 114 stdout.writeln('>>> BATCH END (${totalTests - testsFailed}/$totalTests)
${time}ms'); |
| 115 exitCode = batchResult.ordinal; | 115 exitCode = batchResult.ordinal; |
| 116 } | 116 } |
| 117 // prepare aruments | 117 // prepare aruments |
| 118 var args; | 118 var args; |
| 119 { | 119 { |
| 120 var lineArgs = line.split(new RegExp('\\s+')); | 120 var lineArgs = line.split(new RegExp('\\s+')); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 139 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); | 139 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); |
| 140 } catch (e, stackTrace) { | 140 } catch (e, stackTrace) { |
| 141 stderr.writeln(e); | 141 stderr.writeln(e); |
| 142 stderr.writeln(stackTrace); | 142 stderr.writeln(stackTrace); |
| 143 stderr.writeln('>>> EOF STDERR'); | 143 stderr.writeln('>>> EOF STDERR'); |
| 144 stdout.writeln('>>> TEST CRASH'); | 144 stdout.writeln('>>> TEST CRASH'); |
| 145 } | 145 } |
| 146 }); | 146 }); |
| 147 } | 147 } |
| 148 } | 148 } |
| OLD | NEW |