Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: tools/testing/dart/test_suite.dart

Issue 527053002: Support passing in a test suite directory through a flag to the testing scripts (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« tools/test.dart ('K') | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 * instead of having to create a custom [StandardTestSuite] subclass. In 635 * instead of having to create a custom [StandardTestSuite] subclass. In
636 * particular, if you add 'path/to/mytestsuite' to [TEST_SUITE_DIRECTORIES] 636 * particular, if you add 'path/to/mytestsuite' to [TEST_SUITE_DIRECTORIES]
637 * in test.dart, this will all be set up for you. 637 * in test.dart, this will all be set up for you.
638 * 638 *
639 * The [StandardTestSuite] also optionally takes a list of servers that have 639 * The [StandardTestSuite] also optionally takes a list of servers that have
640 * been started up by the test harness, to be used by browser tests. 640 * been started up by the test harness, to be used by browser tests.
641 */ 641 */
642 factory StandardTestSuite.forDirectory(Map configuration, Path directory) { 642 factory StandardTestSuite.forDirectory(Map configuration, Path directory) {
643 final name = directory.filename; 643 final name = directory.filename;
644 644
645 var status_paths = ['$directory/$name.status',
646 '$directory/.status',
ricow1 2014/09/01 13:00:48 added this by request, since the file should live
647 '$directory/${name}_dart2js.status',
648 '$directory/${name}_analyzer.status',
649 '$directory/${name}_analyzer2.status'];
650
645 return new StandardTestSuite(configuration, 651 return new StandardTestSuite(configuration,
646 name, directory, 652 name, directory,
647 ['$directory/$name.status', '$directory/${name}_dart2js.status', 653 status_paths,
648 '$directory/${name}_analyzer.status', '$directory/${name}_analyzer2.sta tus'],
649 isTestFilePredicate: (filename) => filename.endsWith('_test.dart'), 654 isTestFilePredicate: (filename) => filename.endsWith('_test.dart'),
650 recursive: true); 655 recursive: true);
651 } 656 }
652 657
653 List<Uri> get dart2JsBootstrapDependencies { 658 List<Uri> get dart2JsBootstrapDependencies {
654 if (!useSdk) return []; 659 if (!useSdk) return [];
655 660
656 var snapshotPath = TestUtils.absolutePath(new Path(buildDir).join( 661 var snapshotPath = TestUtils.absolutePath(new Path(buildDir).join(
657 new Path('dart-sdk/bin/snapshots/' 662 new Path('dart-sdk/bin/snapshots/'
658 'utils_wrapper.dart.snapshot'))).toString(); 663 'utils_wrapper.dart.snapshot'))).toString();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 updater.onUpdated.add(() => completer.complete(null)); 726 updater.onUpdated.add(() => completer.complete(null));
722 727
723 return completer.future; 728 return completer.future;
724 } 729 }
725 730
726 /** 731 /**
727 * Reads the status files and completes with the parsed expectations. 732 * Reads the status files and completes with the parsed expectations.
728 */ 733 */
729 Future<TestExpectations> readExpectations() { 734 Future<TestExpectations> readExpectations() {
730 var statusFiles = statusFilePaths.where((String statusFilePath) { 735 var statusFiles = statusFilePaths.where((String statusFilePath) {
731 // [forDirectory] adds name_$compiler.status for all tests suites. 736 var file = new File(dartDir.append(statusFilePath).toNativePath());
ricow1 2014/09/01 13:00:49 this basically says: allow any of the files specif
732 // Use it if it exists, but otherwise skip it and don't fail. 737 return file.existsSync();
733 if (statusFilePath.endsWith('_dart2js.status') ||
734 statusFilePath.endsWith('_analyzer.status') ||
735 statusFilePath.endsWith('_analyzer2.status')) {
736 var file = new File(dartDir.append(statusFilePath).toNativePath());
737 return file.existsSync();
738 }
739 return true;
740 }).map((statusFilePath) { 738 }).map((statusFilePath) {
741 return dartDir.append(statusFilePath).toNativePath(); 739 return dartDir.append(statusFilePath).toNativePath();
742 }).toList(); 740 }).toList();
743 741
744 return ReadTestExpectations(statusFiles, configuration); 742 return ReadTestExpectations(statusFiles, configuration);
745 } 743 }
746 744
747 Future enqueueTests() { 745 Future enqueueTests() {
748 Directory dir = new Directory(suiteDir.toNativePath()); 746 Directory dir = new Directory(suiteDir.toNativePath());
749 return dir.exists().then((exists) { 747 return dir.exists().then((exists) {
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 * $pass tests are expected to pass 2286 * $pass tests are expected to pass
2289 * $failOk tests are expected to fail that we won't fix 2287 * $failOk tests are expected to fail that we won't fix
2290 * $fail tests are expected to fail that we should fix 2288 * $fail tests are expected to fail that we should fix
2291 * $crash tests are expected to crash that we should fix 2289 * $crash tests are expected to crash that we should fix
2292 * $timeout tests are allowed to timeout 2290 * $timeout tests are allowed to timeout
2293 * $compileErrorSkip tests are skipped on browsers due to compile-time error 2291 * $compileErrorSkip tests are skipped on browsers due to compile-time error
2294 """; 2292 """;
2295 print(report); 2293 print(report);
2296 } 2294 }
2297 } 2295 }
OLDNEW
« tools/test.dart ('K') | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698