| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 // prepare aruments | 87 // prepare aruments |
| 88 var args; | 88 var args; |
| 89 { | 89 { |
| 90 var lineArgs = line.split(new RegExp('\\s+')); | 90 var lineArgs = line.split(new RegExp('\\s+')); |
| 91 args = new List<String>(); | 91 args = new List<String>(); |
| 92 args.addAll(sharedArgs); | 92 args.addAll(sharedArgs); |
| 93 args.addAll(lineArgs); | 93 args.addAll(lineArgs); |
| 94 args.remove('-b'); | 94 args.remove('-b'); |
| 95 args.remove('--batch'); | 95 args.remove('--batch'); |
| 96 // TODO(scheglov) https://code.google.com/p/dart/issues/detail?id=11061 | |
| 97 args.remove('-batch'); | |
| 98 } | 96 } |
| 99 // analyze single set of arguments | 97 // analyze single set of arguments |
| 100 try { | 98 try { |
| 101 totalTests++; | 99 totalTests++; |
| 102 ErrorSeverity result = handler(args); | 100 ErrorSeverity result = handler(args); |
| 103 bool resultPass = result != ErrorSeverity.ERROR; | 101 bool resultPass = result != ErrorSeverity.ERROR; |
| 104 if (!resultPass) { | 102 if (!resultPass) { |
| 105 testsFailed++; | 103 testsFailed++; |
| 106 } | 104 } |
| 107 batchResult = batchResult.max(result); | 105 batchResult = batchResult.max(result); |
| 108 // Write stderr end token and flush. | 106 // Write stderr end token and flush. |
| 109 stderr.writeln('>>> EOF STDERR'); | 107 stderr.writeln('>>> EOF STDERR'); |
| 110 String resultPassString = resultPass ? 'PASS' : 'FAIL'; | 108 String resultPassString = resultPass ? 'PASS' : 'FAIL'; |
| 111 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); | 109 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon
ds}ms'); |
| 112 } catch (e, stackTrace) { | 110 } catch (e, stackTrace) { |
| 113 stderr.writeln(e); | 111 stderr.writeln(e); |
| 114 stderr.writeln(stackTrace); | 112 stderr.writeln(stackTrace); |
| 115 stderr.writeln('>>> EOF STDERR'); | 113 stderr.writeln('>>> EOF STDERR'); |
| 116 stdout.writeln('>>> TEST CRASH'); | 114 stdout.writeln('>>> TEST CRASH'); |
| 117 } | 115 } |
| 118 }); | 116 }); |
| 119 } | 117 } |
| 120 } | 118 } |
| OLD | NEW |