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

Side by Side 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: Respond to more comments. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/src/TestRunnerTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 directoryPath = "tests/corelib/src";
11 Function doTest;
12 Function doDone;
13 String shellPath;
14 String pathSeparator;
15
16 CorelibTestSuite() {
17 shellPath = getDartShellFileName() ;
18 pathSeparator = new Platform().pathSeparator();
19 }
20
21 void forEachTest(Function onTest, [Function onDone = null]) {
22 doTest = onTest;
23 doDone = onDone;
24 processDirectory();
25 }
26
27 void processDirectory() {
28 Directory dir = new Directory(directoryPath);
29 if (!dir.existsSync()) {
30 dir = new Directory(".." + pathSeparator + directoryPath);
31 Expect.isTrue(dir.existsSync(),
32 "Cannot find tests/corelib/src or ../tests/corelib/src");
33 // TODO(ager): Use dir.errorHandler instead when it is implemented.
34 }
35 dir.fileHandler = processFile;
36 dir.doneHandler = doDone;
37 dir.list(false);
38 }
39
40 void processFile(String filename) {
41 if (filename.endsWith("Test.dart")) {
42 int start = filename.lastIndexOf(pathSeparator);
43 String displayName = filename.substring(start + 1, filename.length - 5);
44 // TODO(whesse): Gather test case info from status file and test file.
45 doTest(new TestCase(displayName,
46 shellPath,
47 <String>["--enable_type_checks",
48 "--ignore-unrecognized-flags",
49 filename ],
50 completeHandler,
51 new Set.from([PASS, FAIL, CRASH, TIMEOUT])));
52 }
53 }
54
55 void completeHandler(TestCase testCase) {
56 TestOutput output = testCase.output;
57 print("Exit code: ${output.exitCode} Time: ${output.time}");
58 }
59 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/src/TestRunnerTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698