| Index: tests/corelib/test_config.dart
|
| diff --git a/tests/corelib/test_config.dart b/tests/corelib/test_config.dart
|
| index d694e56bc33635092990a3ef8acfaecc13287f84..46455f5222820b7d005b6d26ebdfbca14b002551 100644
|
| --- a/tests/corelib/test_config.dart
|
| +++ b/tests/corelib/test_config.dart
|
| @@ -9,19 +9,31 @@
|
|
|
| class CorelibTestSuite {
|
| String directoryPath = "tests/corelib/src";
|
| + final String statusFilePath = "tests/corelib/corelib.status";
|
| Function doTest;
|
| Function doDone;
|
| String shellPath;
|
| String pathSeparator;
|
| + Map<String, String> configuration;
|
| + TestExpectationsMap testExpectationsMap;
|
|
|
| CorelibTestSuite() {
|
| shellPath = getDartShellFileName() ;
|
| pathSeparator = new Platform().pathSeparator();
|
| + configuration = {"mode": "debug",
|
| + "arch": "ia32",
|
| + "checked": "true",
|
| + "component": "vm",
|
| + "system": new Platform().operatingSystem()};
|
| }
|
|
|
| void forEachTest(Function onTest, [Function onDone = null]) {
|
| doTest = onTest;
|
| doDone = onDone;
|
| +
|
| + // Read test expectations from status file.
|
| + testExpectationsMap = ReadTestExpectations(statusFilePath, configuration);
|
| +
|
| processDirectory();
|
| }
|
|
|
| @@ -37,22 +49,34 @@ class CorelibTestSuite {
|
| }
|
|
|
| void processFile(String filename) {
|
| - if (filename.endsWith("Test.dart")) {
|
| - int start = filename.lastIndexOf(pathSeparator);
|
| - String displayName = filename.substring(start + 1, filename.length - 5);
|
| - // TODO(whesse): Gather test case info from status file and test file.
|
| - doTest(new TestCase(displayName,
|
| - shellPath,
|
| - <String>["--enable_type_checks",
|
| - "--ignore-unrecognized-flags",
|
| - filename ],
|
| - completeHandler,
|
| - new Set.from([PASS, FAIL, CRASH, TIMEOUT])));
|
| - }
|
| + if (!filename.endsWith("Test.dart")) return;
|
| +
|
| + Expect.isTrue(filename.contains(directoryPath));
|
| + int start = filename.lastIndexOf(pathSeparator);
|
| + String testName = filename.substring(start + 1, filename.length - 5);
|
| + Set<String> expectations = testExpectationsMap.expectations(testName);
|
| +
|
| + // TODO(whesse): Skip files with internal directives, and multipart files,
|
| + // until they are handled correctly.
|
| + if (expectations.contains(SKIP)) return;
|
| +
|
| +
|
| + doTest(new TestCase(testName,
|
| + shellPath,
|
| + <String>["--enable_type_checks",
|
| + "--ignore-unrecognized-flags",
|
| + filename ],
|
| + completeHandler,
|
| + expectations));
|
| }
|
|
|
| void completeHandler(TestCase testCase) {
|
| TestOutput output = testCase.output;
|
| - print("Exit code: ${output.exitCode} Time: ${output.time}");
|
| + String expected = "";
|
| + testCase.expectedOutcomes.forEach((value) { expected += value + " "; });
|
| + print("");
|
| + print(testCase.displayName);
|
| + print(" Result:${output.result} Expected:$expected");
|
| + print(" Exit code: ${output.exitCode} Time: ${output.time}");
|
| }
|
| }
|
|
|