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

Unified Diff: tests/corelib/test_config.dart

Issue 8492013: Add asynchronous test suite runner to Dart rewrite of test scripts. (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/standalone/standalone.status » ('j') | tests/standalone/standalone.status » ('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
new file mode 100644
index 0000000000000000000000000000000000000000..4d7072a954245cafee2d783c0a95b57e414b7a99
--- /dev/null
+++ b/tests/corelib/test_config.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#library("corelib_test_config");
+
+#import("../../tools/testing/dart/test_runner.dart");
+
+class CorelibTestSuite {
+ final String VM_PATH =
Mads Ager (google) 2011/11/08 08:26:06 Need something else here.
Bill Hesse 2011/11/08 14:38:56 Done.
+ "/usr/local/google/home/whesse/dart/out/Debug_ia32/dart_bin";
+
+ Function handleTest;
+ Function doneCallback;
Mads Ager (google) 2011/11/08 08:26:06 Can we make the naming more uniform here? handle
Bill Hesse 2011/11/08 14:38:56 Done.
+ final String directoryPath = "tests/corelib/src";
Mads Ager (google) 2011/11/08 08:26:06 This only works in the top-level directory, right?
Bill Hesse 2011/11/08 14:38:56 Now it also works in the runtime directory. On 20
+
+ CorelibTestSuite();
+
+ void getTests(Function callback ,[Function done = null]) {
Mads Ager (google) 2011/11/08 08:26:06 Maybe some other name that indicates that we do no
Bill Hesse 2011/11/08 14:38:56 Done.
+ handleTest = callback;
+ doneCallback = done;
+ processDirectory();
+ }
+
+ void processDirectory() {
+ Directory dir = new Directory(directoryPath);
+ if (!dir.existsSync()) return null;
Mads Ager (google) 2011/11/08 08:26:06 Just 'return' instead of 'return null'? Could you
Bill Hesse 2011/11/08 14:38:56 Done.
+ dir.fileHandler = processFile;
+ dir.doneHandler = doneCallback;
+ dir.list(false);
+ }
+
+ void processFile(String filename) {
+ if (filename.endsWith("Test.dart")) {
Mads Ager (google) 2011/11/08 08:26:06 Let's not check for "Test.dart" but only for ".dar
Bill Hesse 2011/11/08 14:38:56 Done.
+ // TODO(whesse): Gather test case info from status file and test file.
+ handleTest(new TestCase(filename, VM_PATH,
Mads Ager (google) 2011/11/08 08:26:06 I would have one argument per line to make it more
Bill Hesse 2011/11/08 14:38:56 Done.
+ ["--enable_type_checks",
+ "--ignore-unrecognized-flags",
+ filename ],
+ completeHandler,
+ new Set.from([PASS, FAIL, CRASH, TIMEOUT])));
+ }
+ }
+
+ void completeHandler(TestCase testCase) {
+ print("Exit code: ${testCase.output.exitCode} Time: ${testCase.output.time}");
Mads Ager (google) 2011/11/08 08:26:06 Long line.
+ }
+}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | tests/standalone/standalone.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698