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

Side by Side Diff: tests/standalone/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 | « tests/corelib/test_config.dart ('k') | no next file » | 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 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
67 shellPath, 67 List<List> optionsList = testOptions(filename);
68 args, 68 if (optionsList.isEmpty()) {
69 configuration["timeout"], 69 doTest(new TestCase(testName,
70 completeHandler, 70 shellPath,
71 expectations)); 71 args,
72 configuration["timeout"],
73 completeHandler,
74 expectations));
75 } else {
76 for (var options in optionsList) {
77 options.addAll(args);
78 doTest(new TestCase(testName,
79 shellPath,
80 options,
81 configuration["timeout"],
82 completeHandler,
83 expectations));
84 }
85 }
86 }
87
88 List<List> testOptions(String filename) {
89 RegExp testOptionsRegExp = const RegExp(@"// VMOptions=(.*)");
90 File file = new File(filename);
91 FileInputStream fileStream = file.openInputStream();
92 StringInputStream lines = new StringInputStream(fileStream);
93
94 List<List> result = new List<List>();
95 String line;
96 while ((line = lines.readLine()) != null) {
97 Match match = testOptionsRegExp.firstMatch(line);
98 if (match != null) {
99 result.add(match[1].split(' ').filter((e) => e != ''));
100 }
101 }
102 return result;
72 } 103 }
73 104
74 void completeHandler(TestCase testCase) { 105 void completeHandler(TestCase testCase) {
75 } 106 }
76 } 107 }
OLDNEW
« no previous file with comments | « tests/corelib/test_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698