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

Unified Diff: tests/co19/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 | « no previous file | tests/corelib/test_config.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/co19/test_config.dart
diff --git a/tests/co19/test_config.dart b/tests/co19/test_config.dart
index a9f25439ad159fb7e98a855b2f4e8e9c765bcd1f..2534279d864c827d2986787762581a3072b9fff9 100644
--- a/tests/co19/test_config.dart
+++ b/tests/co19/test_config.dart
@@ -4,89 +4,19 @@
#library("co19_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 Co19TestSuite {
- String directoryPath = "tests/co19/src";
- Function doTest;
- Function doDone;
- String shellPath;
- String pathSeparator;
- Map configuration;
- TestExpectations testExpectations;
- RegExp testRegExp;
+class Co19TestSuite extends StandardTestSuite {
+ RegExp _testRegExp = const RegExp(@"t[0-9]{2}.dart$");
- Co19TestSuite(Map this.configuration) {
- shellPath = getDartShellFileName(configuration) ;
- pathSeparator = new Platform().pathSeparator();
- testRegExp = new RegExp(@"t[0-9]{2}.dart$");
- }
+ Co19TestSuite(Map configuration)
+ : super(configuration,
+ "tests/co19/src",
+ ["tests/co19/co19-compiler.status",
+ "tests/co19/co19-runtime.status",
+ "tests/co19/co19-frog.status"]);
- void forEachTest(Function onTest, [Function onDone = null]) {
- doTest = onTest;
- doDone = (ignore) => onDone();
-
- // Read test expectations from status file.
- testExpectations = new TestExpectations(complexMatching: true);
- ReadTestExpectationsInto(testExpectations,
- "tests/co19/co19-compiler.status",
- configuration);
- ReadTestExpectationsInto(testExpectations,
- "tests/co19/co19-frog.status",
- configuration);
- ReadTestExpectationsInto(testExpectations,
- "tests/co19/co19-runtime.status",
- configuration);
-
- processDirectory(directoryPath);
- }
-
- void processDirectory(String path) {
- path = getDirname(path);
- Directory dir = new Directory(path);
- dir.errorHandler = (s) {
- throw s;
- };
- dir.fileHandler = processFile;
- dir.doneHandler = doDone;
- dir.list(recursive: true);
- }
-
- void processFile(String filename) {
- if (!testRegExp.hasMatch(filename)) 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('src' + pathSeparator);
- String testName = filename.substring(start + 4, 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 test) {
- }
+ bool isTestFile(String filename) => _testRegExp.hasMatch(filename);
+ void listRecursively() => true;
+ void complexStatusMatching() => true;
}
« no previous file with comments | « no previous file | tests/corelib/test_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698