| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 } | 659 } |
| 660 args.addAll(['--libdir=$libdir', | 660 args.addAll(['--libdir=$libdir', |
| 661 '--compile-only', | 661 '--compile-only', |
| 662 '--out=$outputFile']); | 662 '--out=$outputFile']); |
| 663 args.addAll(vmOptions); | 663 args.addAll(vmOptions); |
| 664 args.add(inputFile); | 664 args.add(inputFile); |
| 665 break; | 665 break; |
| 666 default: | 666 default: |
| 667 Expect.fail('unimplemented compiler $compiler'); | 667 Expect.fail('unimplemented compiler $compiler'); |
| 668 } | 668 } |
| 669 if (executable.endsWith('.dart')) { |
| 670 // Run the compiler script via the Dart VM. |
| 671 args.insertRange(0, 1, executable); |
| 672 executable = TestUtils.dartShellFileName(configuration); |
| 673 } |
| 669 return new Command(executable, args); | 674 return new Command(executable, args); |
| 670 } | 675 } |
| 671 | 676 |
| 672 bool get requiresCleanTemporaryDirectory() => | 677 bool get requiresCleanTemporaryDirectory() => |
| 673 configuration['compiler'] == 'dartc'; | 678 configuration['compiler'] == 'dartc'; |
| 674 | 679 |
| 675 /** | 680 /** |
| 676 * Create a directory for the generated test. If a Dart language test | 681 * Create a directory for the generated test. If a Dart language test |
| 677 * needs to be run in a browser, the Dart test needs to be embedded in | 682 * needs to be run in a browser, the Dart test needs to be embedded in |
| 678 * an HTML page, with a testing framework based on scripting and DOM events. | 683 * an HTML page, with a testing framework based on scripting and DOM events. |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 return 'compiler/bin/dartc$suffix'; | 1255 return 'compiler/bin/dartc$suffix'; |
| 1251 case 'frog': | 1256 case 'frog': |
| 1252 case 'dart2js': | 1257 case 'dart2js': |
| 1253 return 'frog/bin/frog$suffix'; | 1258 return 'frog/bin/frog$suffix'; |
| 1254 default: | 1259 default: |
| 1255 throw "Unknown compiler for: ${configuration['compiler']}"; | 1260 throw "Unknown compiler for: ${configuration['compiler']}"; |
| 1256 } | 1261 } |
| 1257 } | 1262 } |
| 1258 | 1263 |
| 1259 static String dartShellFileName(Map configuration) { | 1264 static String dartShellFileName(Map configuration) { |
| 1260 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 1265 var name = configuration['dart']; |
| 1266 if (name == '') { |
| 1267 name = '${buildDir(configuration)}/${executableName(configuration)}'; |
| 1268 } |
| 1261 if (!(new File(name)).existsSync() && !configuration['list']) { | 1269 if (!(new File(name)).existsSync() && !configuration['list']) { |
| 1262 throw "Executable '$name' does not exist"; | 1270 throw "Executable '$name' does not exist"; |
| 1263 } | 1271 } |
| 1264 return name; | 1272 return name; |
| 1265 } | 1273 } |
| 1266 | 1274 |
| 1267 static String compilerPath(Map configuration) { | 1275 static String compilerPath(Map configuration) { |
| 1268 if (configuration['compiler'] == 'none') { | 1276 if (configuration['compiler'] == 'none') { |
| 1269 return null; // No separate compiler for dartium tests. | 1277 return null; // No separate compiler for dartium tests. |
| 1270 } | 1278 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1375 * $noCrash tests are expected to be flaky but not crash | 1383 * $noCrash tests are expected to be flaky but not crash |
| 1376 * $pass tests are expected to pass | 1384 * $pass tests are expected to pass |
| 1377 * $failOk tests are expected to fail that we won't fix | 1385 * $failOk tests are expected to fail that we won't fix |
| 1378 * $fail tests are expected to fail that we should fix | 1386 * $fail tests are expected to fail that we should fix |
| 1379 * $crash tests are expected to crash that we should fix | 1387 * $crash tests are expected to crash that we should fix |
| 1380 * $timeout tests are allowed to timeout | 1388 * $timeout tests are allowed to timeout |
| 1381 """; | 1389 """; |
| 1382 print(report); | 1390 print(report); |
| 1383 } | 1391 } |
| 1384 } | 1392 } |
| OLD | NEW |