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

Side by Side Diff: tests/standalone/test_config.dart

Issue 8508054: Getting started on options parsing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review 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 | « tests/corelib/test_config.dart ('k') | tools/test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("standalone_test_config"); 5 #library("standalone_test_config");
6 6
7 #import("../../tools/testing/dart/test_runner.dart"); 7 #import("../../tools/testing/dart/test_runner.dart");
8 #import("../../tools/testing/dart/status_file_parser.dart"); 8 #import("../../tools/testing/dart/status_file_parser.dart");
9 9
10 class StandaloneTestSuite { 10 class StandaloneTestSuite {
(...skipping 16 matching lines...) Expand all
27 // Read configuration from status file. 27 // Read configuration from status file.
28 List<Section> sections = new List<Section>(); 28 List<Section> sections = new List<Section>();
29 ReadConfigurationInto(statusFilePath, sections); 29 ReadConfigurationInto(statusFilePath, sections);
30 30
31 processDirectory(); 31 processDirectory();
32 } 32 }
33 33
34 void processDirectory() { 34 void processDirectory() {
35 directoryPath = getDirname(directoryPath); 35 directoryPath = getDirname(directoryPath);
36 Directory dir = new Directory(directoryPath); 36 Directory dir = new Directory(directoryPath);
37 Expect.isTrue(dir.existsSync(), 37 dir.errorHandler = (s) {
38 "Cannot find tests/standalone/src or ../tests/standalone/src"); 38 throw s;
39 // TODO(ager): Use dir.errorHandler instead when it is implemented. 39 };
40 dir.fileHandler = processFile; 40 dir.fileHandler = processFile;
41 dir.doneHandler = doDone; 41 dir.doneHandler = doDone;
42 dir.list(false); 42 dir.list(false);
43 } 43 }
44 44
45 void processFile(String filename) { 45 void processFile(String filename) {
46 if (!filename.endsWith("Test.dart")) return; 46 if (!filename.endsWith("Test.dart")) return;
47 int start = filename.lastIndexOf(pathSeparator); 47 int start = filename.lastIndexOf(pathSeparator);
48 String testName = filename.substring(start + 1, filename.length - 5); 48 String testName = filename.substring(start + 1, filename.length - 5);
49 // TODO(whesse): Gather test case info from status file and test file. 49 // TODO(whesse): Gather test case info from status file and test file.
50 doTest(new TestCase(testName, 50 doTest(new TestCase(testName,
51 shellPath, 51 shellPath,
52 <String>["--enable_type_checks", 52 <String>["--enable_type_checks",
53 "--ignore-unrecognized-flags", 53 "--ignore-unrecognized-flags",
54 filename ], 54 filename ],
55 completeHandler, 55 completeHandler,
56 new Set.from([PASS, FAIL, CRASH, TIMEOUT]))); 56 new Set.from([PASS, FAIL, CRASH, TIMEOUT])));
57 } 57 }
58 58
59 void completeHandler(TestCase testCase) { 59 void completeHandler(TestCase testCase) {
60 TestOutput output = testCase.output; 60 TestOutput output = testCase.output;
61 print("Exit code: ${output.exitCode} Time: ${output.time}"); 61 print("Exit code: ${output.exitCode} Time: ${output.time}");
62 } 62 }
63 } 63 }
OLDNEW
« no previous file with comments | « tests/corelib/test_config.dart ('k') | tools/test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698