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

Unified Diff: tests/corelib/test_config.dart

Issue 8514003: tools/test.dart: Read test expectations from the status file, and pass them to the test runner. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Import library with PASS, FAIL, CRASH to TestRunnerTest 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/standalone/src/TestRunnerTest.dart » ('j') | tests/standalone/src/TestRunnerTest.dart » ('J')
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 5d303b1a74f90af456be6aa0b30bb78bdd740075..fc0d9449f01c7c0e440e01b7a60e79b532adc666 100644
--- a/tests/corelib/test_config.dart
+++ b/tests/corelib/test_config.dart
@@ -5,55 +5,78 @@
#library("corelib_test_config");
#import("../../tools/testing/dart/test_runner.dart");
+#import("../../tools/testing/dart/status_file_parser.dart");
class CorelibTestSuite {
- final String directoryPath = "tests/corelib/src";
+ 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",
Mads Ager (google) 2011/11/10 16:31:57 In the next changelist we can replace this with th
+ "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();
}
void processDirectory() {
+ directoryPath = getDirname(directoryPath);
Directory dir = new Directory(directoryPath);
- if (!dir.existsSync()) {
- dir = new Directory(".." + pathSeparator + directoryPath);
- Expect.isTrue(dir.existsSync(),
- "Cannot find tests/corelib/src or ../tests/corelib/src");
+ Expect.isTrue(dir.existsSync(),
+ "Cannot find tests/corelib/src or ../tests/corelib/src");
// TODO(ager): Use dir.errorHandler instead when it is implemented.
- }
dir.fileHandler = processFile;
dir.doneHandler = doDone;
dir.list(false);
}
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}");
}
}
« no previous file with comments | « no previous file | tests/standalone/src/TestRunnerTest.dart » ('j') | tests/standalone/src/TestRunnerTest.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698