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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 * | 471 * |
472 * The [StandardTestSuite] also optionally takes a list of servers that have | 472 * The [StandardTestSuite] also optionally takes a list of servers that have |
473 * been started up by the test harness, to be used by browser tests. | 473 * been started up by the test harness, to be used by browser tests. |
474 */ | 474 */ |
475 factory StandardTestSuite.forDirectory( | 475 factory StandardTestSuite.forDirectory( |
476 Map configuration, Path directory) { | 476 Map configuration, Path directory) { |
477 final name = directory.filename; | 477 final name = directory.filename; |
478 | 478 |
479 return new StandardTestSuite(configuration, | 479 return new StandardTestSuite(configuration, |
480 name, directory, | 480 name, directory, |
481 ['$directory/$name.status', '$directory/${name}_dart2js.status'], | 481 ['$directory/$name.status', '$directory/${name}_dart2js.status', |
| 482 '$directory/${name}_analyzer.status', '$directory/${name}_analyzer2.sta
tus'], |
482 isTestFilePredicate: (filename) => filename.endsWith('_test.dart'), | 483 isTestFilePredicate: (filename) => filename.endsWith('_test.dart'), |
483 recursive: true); | 484 recursive: true); |
484 } | 485 } |
485 | 486 |
486 List<Uri> get dart2JsBootstrapDependencies { | 487 List<Uri> get dart2JsBootstrapDependencies { |
487 if (!useSdk) return []; | 488 if (!useSdk) return []; |
488 | 489 |
489 var snapshotPath = TestUtils.absolutePath(new Path(buildDir).join( | 490 var snapshotPath = TestUtils.absolutePath(new Path(buildDir).join( |
490 new Path('dart-sdk/bin/snapshots/' | 491 new Path('dart-sdk/bin/snapshots/' |
491 'utils_wrapper.dart.snapshot'))).toString(); | 492 'utils_wrapper.dart.snapshot'))).toString(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 | 558 |
558 var filesRead = 0; | 559 var filesRead = 0; |
559 void statusFileRead() { | 560 void statusFileRead() { |
560 filesRead++; | 561 filesRead++; |
561 if (filesRead == statusFilePaths.length) { | 562 if (filesRead == statusFilePaths.length) { |
562 completer.complete(expectations); | 563 completer.complete(expectations); |
563 } | 564 } |
564 } | 565 } |
565 | 566 |
566 for (var statusFilePath in statusFilePaths) { | 567 for (var statusFilePath in statusFilePaths) { |
567 // [forDirectory] adds name_dart2js.status for all tests suites. Use it | 568 // [forDirectory] adds name_$compiler.status for all tests suites. Use it |
568 // if it exists, but otherwise skip it and don't fail. | 569 // if it exists, but otherwise skip it and don't fail. |
569 if (statusFilePath.endsWith('_dart2js.status')) { | 570 if (statusFilePath.endsWith('_dart2js.status') || |
| 571 statusFilePath.endsWith('_analyzer.status') || |
| 572 statusFilePath.endsWith('_analyzer2.status')) { |
570 var file = new File.fromPath(dartDir.append(statusFilePath)); | 573 var file = new File.fromPath(dartDir.append(statusFilePath)); |
571 if (!file.existsSync()) { | 574 if (!file.existsSync()) { |
572 filesRead++; | 575 filesRead++; |
573 continue; | 576 continue; |
574 } | 577 } |
575 } | 578 } |
576 | 579 |
577 ReadTestExpectationsInto(expectations, | 580 ReadTestExpectationsInto(expectations, |
578 dartDir.append(statusFilePath).toNativePath(), | 581 dartDir.append(statusFilePath).toNativePath(), |
579 configuration, statusFileRead); | 582 configuration, statusFileRead); |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 * $pass tests are expected to pass | 1965 * $pass tests are expected to pass |
1963 * $failOk tests are expected to fail that we won't fix | 1966 * $failOk tests are expected to fail that we won't fix |
1964 * $fail tests are expected to fail that we should fix | 1967 * $fail tests are expected to fail that we should fix |
1965 * $crash tests are expected to crash that we should fix | 1968 * $crash tests are expected to crash that we should fix |
1966 * $timeout tests are allowed to timeout | 1969 * $timeout tests are allowed to timeout |
1967 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 1970 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
1968 """; | 1971 """; |
1969 print(report); | 1972 print(report); |
1970 } | 1973 } |
1971 } | 1974 } |
OLD | NEW |