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

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

Issue 8536013: tools/test.dart: Handle VMOptions lines in test files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase to TOT 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/test_config.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("corelib_test_config"); 5 #library("corelib_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 CorelibTestSuite { 10 class CorelibTestSuite {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 List args = ["--ignore-unrecognized-flags"]; 57 List args = ["--ignore-unrecognized-flags"];
58 if (configuration["checked"]) { 58 if (configuration["checked"]) {
59 args.add("--enable_type_checks"); 59 args.add("--enable_type_checks");
60 } 60 }
61 if (configuration["component"] == "leg") { 61 if (configuration["component"] == "leg") {
62 args.add("--enable_leg"); 62 args.add("--enable_leg");
63 } 63 }
64 args.add(filename); 64 args.add(filename);
65 65
66 doTest(new TestCase(testName, 66 List<List> optionsList = testOptions(filename);
67 shellPath, 67 if (optionsList.isEmpty()) {
68 args, 68 doTest(new TestCase(testName,
69 configuration["timeout"], 69 shellPath,
70 completeHandler, 70 args,
71 expectations)); 71 configuration["timeout"],
72 completeHandler,
73 expectations));
74 } else {
75 for (var options in optionsList) {
76 options.addAll(args);
77 doTest(new TestCase(testName,
78 shellPath,
79 options,
80 configuration["timeout"],
81 completeHandler,
82 expectations));
83 }
84 }
85 }
86
87 List<List> testOptions(String filename) {
88 RegExp testOptionsRegExp = const RegExp(@"// VMOptions=(.*)");
89 File file = new File(filename);
90 FileInputStream fileStream = file.openInputStream();
91 StringInputStream lines = new StringInputStream(fileStream);
92
93 List<List> result = new List<List>();
94 String line;
95 while ((line = lines.readLine()) != null) {
96 Match match = testOptionsRegExp.firstMatch(line);
97 if (match != null) {
98 result.add(match[1].split(' ').filter((e) => e != ''));
99 }
100 }
101 return result;
72 } 102 }
73 103
74 void completeHandler(TestCase testCase) { 104 void completeHandler(TestCase testCase) {
75 } 105 }
76 } 106 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/test_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698