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

Unified Diff: tests/standalone/test_config.dart

Issue 8507010: Make tools/test.dart read standalone.status status file when running tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unimplemented stubs and classes. 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 | tools/testing/dart/status_file_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/test_config.dart
diff --git a/tests/standalone/test_config.dart b/tests/standalone/test_config.dart
index 170de26c172f5dda8f9a80ab0b35ea52e94f979a..837285c0c8cec677ef855c39e44133824a8fb3ab 100644
--- a/tests/standalone/test_config.dart
+++ b/tests/standalone/test_config.dart
@@ -5,9 +5,11 @@
#library("standalone_test_config");
#import("../../tools/testing/dart/test_runner.dart");
+#import("../../tools/testing/dart/status_file_parser.dart");
class StandaloneTestSuite {
- final String directoryPath = "tests/standalone/src";
+ String directoryPath = "tests/standalone/src";
+ final String statusFilePath = "tests/standalone/standalone.status";
Function doTest;
Function doDone;
String shellPath;
@@ -21,35 +23,37 @@ class StandaloneTestSuite {
void forEachTest(Function onTest, [Function onDone = null]) {
doTest = onTest;
doDone = onDone;
+
+ // Read configuration from status file.
+ List<Section> sections = new List<Section>();
+ ReadConfigurationInto(statusFilePath, sections);
+
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/standalone/src or ../tests/standalone/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;
+ int start = filename.lastIndexOf(pathSeparator);
+ String testName = filename.substring(start + 1, filename.length - 5);
+ // TODO(whesse): Gather test case info from status file and test file.
+ doTest(new TestCase(testName,
+ shellPath,
+ <String>["--enable_type_checks",
+ "--ignore-unrecognized-flags",
+ filename ],
+ completeHandler,
+ new Set.from([PASS, FAIL, CRASH, TIMEOUT])));
}
void completeHandler(TestCase testCase) {
« no previous file with comments | « no previous file | tools/testing/dart/status_file_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698