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

Side by Side Diff: tools/testing/dart/test_runner.dart

Issue 9691044: In test_runner.dart, trim spaces from a special command before checking an assert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months 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 | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * Classes and methods for executing tests. 6 * Classes and methods for executing tests.
7 * 7 *
8 * This module includes: 8 * This module includes:
9 * - Managing parallel execution of tests, including timeout checks. 9 * - Managing parallel execution of tests, including timeout checks.
10 * - Evaluating the output of each test as pass/fail/crash/timeout. 10 * - Evaluating the output of each test as pass/fail/crash/timeout.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // Special command handling. If a special command is specified 84 // Special command handling. If a special command is specified
85 // we have to completely rewrite the command that we are using. 85 // we have to completely rewrite the command that we are using.
86 // We generate a new command-line that is the special command 86 // We generate a new command-line that is the special command
87 // where we replace '@' with the original command. 87 // where we replace '@' with the original command.
88 var specialCommand = configuration['special-command']; 88 var specialCommand = configuration['special-command'];
89 if (!specialCommand.isEmpty()) { 89 if (!specialCommand.isEmpty()) {
90 Expect.isTrue(specialCommand.contains('@'), 90 Expect.isTrue(specialCommand.contains('@'),
91 "special-command must contain a '@' char"); 91 "special-command must contain a '@' char");
92 var specialCommandSplit = specialCommand.split('@'); 92 var specialCommandSplit = specialCommand.split('@');
93 var prefix = specialCommandSplit[0]; 93 var prefix = specialCommandSplit[0].trim();
94 var suffix = specialCommandSplit[1]; 94 var suffix = specialCommandSplit[1].trim();
95 List<Command> newCommands = []; 95 List<Command> newCommands = [];
96 for (Command c in commands) { 96 for (Command c in commands) {
97 var newExecutablePath; 97 var newExecutablePath;
98 var newArguments = []; 98 var newArguments = [];
99 99
100 if (prefix.length > 0) { 100 if (prefix.length > 0) {
101 var prefixSplit = prefix.split(' '); 101 var prefixSplit = prefix.split(' ');
102 newExecutablePath = prefixSplit[0]; 102 newExecutablePath = prefixSplit[0];
103 for (int i = 1; i < prefixSplit.length; i++) { 103 for (int i = 1; i < prefixSplit.length; i++) {
104 var current = prefixSplit[i]; 104 var current = prefixSplit[i];
105 if (!current.isEmpty()) newArguments.add(current); 105 if (!current.isEmpty()) newArguments.add(current);
106 } 106 }
107 newArguments.add(c.executable); 107 newArguments.add(c.executable);
108 } 108 }
109 newArguments.addAll(c.arguments); 109 newArguments.addAll(c.arguments);
110 var suffixSplit = suffix.split(' '); 110 var suffixSplit = suffix.split(' ');
111 suffixSplit.forEach((e) { 111 suffixSplit.forEach((e) {
112 if (!e.isEmpty()) newArguments.add(e); 112 if (!e.isEmpty()) newArguments.add(e);
113 }); 113 });
114 final newCommand = new Command(newExecutablePath, newArguments); 114 final newCommand = new Command(newExecutablePath, newArguments);
115 newCommands.add(newCommand); 115 newCommands.add(newCommand);
116 Expect.stringEquals('$prefix ${c.commandLine} $suffix', 116 // If there are extra spaces inside the prefix or suffix, this fails.
117 Expect.stringEquals('$prefix ${c.commandLine} $suffix'.trim(),
117 newCommand.commandLine); 118 newCommand.commandLine);
118 } 119 }
119 commands = newCommands; 120 commands = newCommands;
120 } 121 }
121 } 122 }
122 123
123 int get timeout() => configuration['timeout']; 124 int get timeout() => configuration['timeout'];
124 125
125 String get configurationString() { 126 String get configurationString() {
126 final component = configuration['component']; 127 final component = configuration['component'];
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 // the developer doesn't waste his or her time trying to fix a bunch of 1108 // the developer doesn't waste his or her time trying to fix a bunch of
1108 // tests that appear to be broken but were actually just flakes that 1109 // tests that appear to be broken but were actually just flakes that
1109 // didn't get retried because there had already been one failure. 1110 // didn't get retried because there had already been one failure.
1110 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; 1111 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests;
1111 new RunningProcess(test, allowRetry, this).start(); 1112 new RunningProcess(test, allowRetry, this).start();
1112 } 1113 }
1113 _numProcesses++; 1114 _numProcesses++;
1114 } 1115 }
1115 } 1116 }
1116 } 1117 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698