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}"); |
+ } |
+} |