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("corelib_test_config"); | |
6 | |
7 #import("../../tools/testing/dart/test_runner.dart"); | |
8 | |
9 class CorelibTestSuite { | |
10 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.
| |
11 "/usr/local/google/home/whesse/dart/out/Debug_ia32/dart_bin"; | |
12 | |
13 Function handleTest; | |
14 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.
| |
15 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
| |
16 | |
17 CorelibTestSuite(); | |
18 | |
19 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.
| |
20 handleTest = callback; | |
21 doneCallback = done; | |
22 processDirectory(); | |
23 } | |
24 | |
25 void processDirectory() { | |
26 Directory dir = new Directory(directoryPath); | |
27 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.
| |
28 dir.fileHandler = processFile; | |
29 dir.doneHandler = doneCallback; | |
30 dir.list(false); | |
31 } | |
32 | |
33 void processFile(String filename) { | |
34 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.
| |
35 // TODO(whesse): Gather test case info from status file and test file. | |
36 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.
| |
37 ["--enable_type_checks", | |
38 "--ignore-unrecognized-flags", | |
39 filename ], | |
40 completeHandler, | |
41 new Set.from([PASS, FAIL, CRASH, TIMEOUT]))); | |
42 } | |
43 } | |
44 | |
45 void completeHandler(TestCase testCase) { | |
46 print("Exit code: ${testCase.output.exitCode} Time: ${testCase.output.tim e}"); | |
Mads Ager (google)
2011/11/08 08:26:06
Long line.
| |
47 } | |
48 } | |
OLD | NEW |