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

Unified Diff: tests/standalone/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
Index: tests/standalone/test_config.dart
diff --git a/tests/standalone/test_config.dart b/tests/standalone/test_config.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d070a4769d4f70c9b688e6d0a776583bafa09a83
--- /dev/null
+++ b/tests/standalone/test_config.dart
@@ -0,0 +1,49 @@
+// 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("standalone_test_config");
+
+#import("../../tools/testing/dart/test_runner.dart");
+
+
+class StandaloneTestSuite {
+ final String VM_PATH =
+ "/usr/local/google/home/whesse/dart/out/Debug_ia32/dart_bin";
Mads Ager (google) 2011/11/08 08:26:06 All the same comments as for the other config file
+
+ Function handleTest;
+ Function doneCallback;
+ final String directoryPath = "tests/standalone/src";
+
+ StandaloneTestSuite();
+
+ void getTests(Function callback ,[Function done = null]) {
+ handleTest = callback;
+ doneCallback = done;
+ processDirectory();
+ }
+
+ void processDirectory() {
+ Directory dir = new Directory(directoryPath);
+ if (!dir.existsSync()) return null;
+ dir.fileHandler = processFile;
+ dir.doneHandler = doneCallback;
+ dir.list(false);
+ }
+
+ void processFile(String filename) {
+ if (filename.endsWith("Test.dart")) {
+ // TODO(whesse): Gather test case info from status file and test file.
+ handleTest(new TestCase(filename, VM_PATH,
+ ["--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}");
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698