| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 library testing.test_dart; | 5 library testing.test_dart; |
| 6 | 6 |
| 7 import 'dart:convert' show | 7 import 'dart:convert' show |
| 8 JSON; | 8 JSON; |
| 9 | 9 |
| 10 import 'dart:io' show | 10 import 'dart:io' show |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 final List<String> commandLines; | 22 final List<String> commandLines; |
| 23 | 23 |
| 24 TestDart(String name, this.common, this.processes, this.commandLines) | 24 TestDart(String name, this.common, this.processes, this.commandLines) |
| 25 : super(name, "test_dart", | 25 : super(name, "test_dart", |
| 26 // This suite doesn't know what it's status file is because test.dart | 26 // This suite doesn't know what it's status file is because test.dart |
| 27 // doesn't know. | 27 // doesn't know. |
| 28 null); | 28 null); |
| 29 | 29 |
| 30 factory TestDart.fromJsonMap(Uri base, Map json, String name, String kind) { | 30 factory TestDart.fromJsonMap(Uri base, Map json, String name, String kind) { |
| 31 String common = json["common"] ?? ""; | 31 String common = json["common"] ?? ""; |
| 32 // TODO(ahe): Compute this value based on number of cores. | 32 String processes = json["processes"] ?? "-j${Platform.numberOfProcessors}"; |
| 33 String processes = json["processes"] ?? "-j16"; | |
| 34 List<String> commandLines = json["command-lines"] ?? <String>[]; | 33 List<String> commandLines = json["command-lines"] ?? <String>[]; |
| 35 return new TestDart(name, common, processes, commandLines); | 34 return new TestDart(name, common, processes, commandLines); |
| 36 } | 35 } |
| 37 | 36 |
| 38 void writeFirstImportOn(StringSink sink) { | 37 void writeFirstImportOn(StringSink sink) { |
| 39 sink.writeln("import 'dart:io' as io;"); | 38 sink.writeln("import 'dart:io' as io;"); |
| 40 sink.writeln( | 39 sink.writeln( |
| 41 "import 'package:testing/src/stdio_process.dart' show StdioProcess;"); | 40 "import 'package:testing/src/stdio_process.dart' show StdioProcess;"); |
| 42 } | 41 } |
| 43 | 42 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 74 } | 73 } |
| 75 } | 74 } |
| 76 """); | 75 """); |
| 77 } | 76 } |
| 78 | 77 |
| 79 String toString() { | 78 String toString() { |
| 80 return "TestDart($name, ${JSON.encode(common)}, ${JSON.encode(processes)}," | 79 return "TestDart($name, ${JSON.encode(common)}, ${JSON.encode(processes)}," |
| 81 " ${JSON.encode(commandLines)})"; | 80 " ${JSON.encode(commandLines)})"; |
| 82 } | 81 } |
| 83 } | 82 } |
| OLD | NEW |