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

Unified Diff: tests/corelib/test_config.dart

Issue 8589020: Enable language and isolate tests using the dart test runner. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/co19/test_config.dart ('k') | tests/isolate/test_config.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/test_config.dart
diff --git a/tests/corelib/test_config.dart b/tests/corelib/test_config.dart
index 5a392ecff0f11df37c7e4e7049917c35a6d11a2e..51b6358f204c30f7802052d6e2e40dc33d358015 100644
--- a/tests/corelib/test_config.dart
+++ b/tests/corelib/test_config.dart
@@ -4,80 +4,11 @@
#library("corelib_test_config");
-#import("../../tools/testing/dart/status_file_parser.dart");
-#import("../../tools/testing/dart/test_config_utils.dart");
-#import("../../tools/testing/dart/test_runner.dart");
+#import("../../tools/testing/dart/test_suite.dart");
-class CorelibTestSuite {
- String directoryPath = "tests/corelib/src";
- final String statusFilePath = "tests/corelib/corelib.status";
- Function doTest;
- Function doDone;
- String shellPath;
- String pathSeparator;
- Map configuration;
- TestExpectations testExpectations;
-
- CorelibTestSuite(Map this.configuration) {
- shellPath = getDartShellFileName(configuration) ;
- pathSeparator = new Platform().pathSeparator();
- }
-
- void forEachTest(Function onTest, [Function onDone = null]) {
- doTest = onTest;
- doDone = (ignore) => onDone();
-
- // Read test expectations from status file.
- testExpectations = new TestExpectations();
- ReadTestExpectationsInto(testExpectations, statusFilePath, configuration);
-
- processDirectory();
- }
-
- void processDirectory() {
- directoryPath = getDirname(directoryPath);
- Directory dir = new Directory(directoryPath);
- dir.errorHandler = (s) {
- throw s;
- };
- dir.fileHandler = processFile;
- dir.doneHandler = doDone;
- dir.list(false);
- }
-
- void processFile(String filename) {
- if (!filename.endsWith("Test.dart")) return;
-
- // If patterns are given only list the files that match one of the
- // patterns.
- var patterns = configuration['patterns'];
- if (!patterns.isEmpty() &&
- !patterns.some((re) => re.hasMatch(filename))) {
- return;
- }
-
- int start = filename.lastIndexOf(pathSeparator);
- String testName = filename.substring(start + 1, filename.length - 5);
- Set<String> expectations = testExpectations.expectations(testName);
-
- if (expectations.contains(SKIP)) return;
-
- var optionsFromFile = TestUtils.optionsFromFile(filename, configuration);
- var argumentLists =
- TestUtils.argumentLists(filename, optionsFromFile, configuration);
- for (var args in argumentLists) {
- var timeout = configuration['timeout'];
- var isNegative = optionsFromFile['isNegative'];
- doTest(new TestCase(testName,
- shellPath,
- args,
- timeout,
- completeHandler,
- expectations,
- isNegative));
- }
- }
-
- void completeHandler(TestCase testCase) {
- }
+class CorelibTestSuite extends StandardTestSuite {
+ CorelibTestSuite(Map configuration)
+ : super(configuration,
+ "tests/corelib/src",
+ ["tests/corelib/corelib.status"]);
}
« no previous file with comments | « tests/co19/test_config.dart ('k') | tests/isolate/test_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698