OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 #library("standalone_test_config"); | |
6 | |
7 #import("../../tools/testing/dart/test_runner.dart"); | |
8 | |
9 | |
10 class StandaloneTestSuite { | |
11 final String VM_PATH = | |
12 "/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
| |
13 | |
14 Function handleTest; | |
15 Function doneCallback; | |
16 final String directoryPath = "tests/standalone/src"; | |
17 | |
18 StandaloneTestSuite(); | |
19 | |
20 void getTests(Function callback ,[Function done = null]) { | |
21 handleTest = callback; | |
22 doneCallback = done; | |
23 processDirectory(); | |
24 } | |
25 | |
26 void processDirectory() { | |
27 Directory dir = new Directory(directoryPath); | |
28 if (!dir.existsSync()) return null; | |
29 dir.fileHandler = processFile; | |
30 dir.doneHandler = doneCallback; | |
31 dir.list(false); | |
32 } | |
33 | |
34 void processFile(String filename) { | |
35 if (filename.endsWith("Test.dart")) { | |
36 // TODO(whesse): Gather test case info from status file and test file. | |
37 handleTest(new TestCase(filename, VM_PATH, | |
38 ["--enable_type_checks", | |
39 "--ignore-unrecognized-flags", | |
40 filename ], | |
41 completeHandler, | |
42 new Set.from([PASS, FAIL, CRASH, TIMEOUT]))); | |
43 } | |
44 } | |
45 | |
46 void completeHandler(TestCase testCase) { | |
47 print("Exit code: ${testCase.output.exitCode} Time: ${testCase.output.tim e}"); | |
48 } | |
49 } | |
OLD | NEW |