| 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;
|
| }
|
|
|