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'; |
| 11 import 'dart:convert'; |
11 import 'dart:io'; | 12 import 'dart:io'; |
12 | 13 |
13 import 'package:analyzer_experimental/src/generated/engine.dart'; | 14 import 'package:analyzer_experimental/src/generated/engine.dart'; |
14 import 'package:analyzer_experimental/src/generated/error.dart'; | 15 import 'package:analyzer_experimental/src/generated/error.dart'; |
15 import 'package:analyzer_experimental/options.dart'; | 16 import 'package:analyzer_experimental/options.dart'; |
16 | 17 |
17 import 'package:analyzer_experimental/src/analyzer_impl.dart'; | 18 import 'package:analyzer_experimental/src/analyzer_impl.dart'; |
18 import 'package:analyzer_experimental/src/error_formatter.dart'; | 19 import 'package:analyzer_experimental/src/error_formatter.dart'; |
19 | 20 |
20 void main() { | 21 void main() { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 static ErrorSeverity runAsBatch(List<String> sharedArgs, BatchRunnerHandler ha
ndler) { | 74 static ErrorSeverity runAsBatch(List<String> sharedArgs, BatchRunnerHandler ha
ndler) { |
74 stdout.writeln('>>> BATCH START'); | 75 stdout.writeln('>>> BATCH START'); |
75 Stopwatch stopwatch = new Stopwatch(); | 76 Stopwatch stopwatch = new Stopwatch(); |
76 stopwatch.start(); | 77 stopwatch.start(); |
77 int testsFailed = 0; | 78 int testsFailed = 0; |
78 int totalTests = 0; | 79 int totalTests = 0; |
79 ErrorSeverity batchResult = ErrorSeverity.NONE; | 80 ErrorSeverity batchResult = ErrorSeverity.NONE; |
80 // read line from stdin | 81 // read line from stdin |
81 Stream cmdLine = stdin | 82 Stream cmdLine = stdin |
82 .transform(new StringDecoder()) | 83 .transform(new StringDecoder()) |
83 .transform(new LineTransformer()); | 84 .transform(new LineSplitter()); |
84 var subscription = cmdLine.listen((String line) { | 85 var subscription = cmdLine.listen((String line) { |
85 // may be finish | 86 // may be finish |
86 if (line.isEmpty) { | 87 if (line.isEmpty) { |
87 var time = stopwatch.elapsedMilliseconds; | 88 var time = stopwatch.elapsedMilliseconds; |
88 stdout.writeln('>>> BATCH END (${totalTests - testsFailed}/$totalTests)
${time}ms'); | 89 stdout.writeln('>>> BATCH END (${totalTests - testsFailed}/$totalTests)
${time}ms'); |
89 exit(batchResult.ordinal); | 90 exit(batchResult.ordinal); |
90 } | 91 } |
91 // prepare aruments | 92 // prepare aruments |
92 var args; | 93 var args; |
93 { | 94 { |
(...skipping 21 matching lines...) Expand all Loading... |
115 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); | 116 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); |
116 } catch (e, stackTrace) { | 117 } catch (e, stackTrace) { |
117 stderr.writeln(e); | 118 stderr.writeln(e); |
118 stderr.writeln(stackTrace); | 119 stderr.writeln(stackTrace); |
119 stderr.writeln('>>> EOF STDERR'); | 120 stderr.writeln('>>> EOF STDERR'); |
120 stdout.writeln('>>> TEST CRASH'); | 121 stdout.writeln('>>> TEST CRASH'); |
121 } | 122 } |
122 }); | 123 }); |
123 } | 124 } |
124 } | 125 } |
OLD | NEW |