Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js |
— | — | @@ -24,6 +24,11 @@ |
25 | 25 | var optimist = require('optimist'); |
26 | 26 | |
27 | 27 | var argv = optimist.usage( 'Usage: $0', { |
| 28 | + 'quick': { |
| 29 | + description: 'Suppress diff output of failed tests', |
| 30 | + boolean: true, |
| 31 | + default: false, |
| 32 | + }, |
28 | 33 | 'quiet': { |
29 | 34 | description: 'Suppress notification of passed tests (shows only failed tests)', |
30 | 35 | boolean: true, |
— | — | @@ -240,7 +245,11 @@ |
241 | 246 | throw new Error('Missing input from test case ' + item.title); |
242 | 247 | } |
243 | 248 | |
244 | | - function printTitle() { |
| 249 | + function printTitle( failure_only ) { |
| 250 | + if( failure_only ) { |
| 251 | + console.log('FAILED'.red + ': ' + item.title.yellow); |
| 252 | + return; |
| 253 | + } |
245 | 254 | console.log('====================================================='); |
246 | 255 | console.log('FAILED'.red + ': ' + item.title.yellow); |
247 | 256 | console.log(item.comments.join('\n')); |
— | — | @@ -285,8 +294,10 @@ |
286 | 295 | var normalizedOut = normalizeOut(out); |
287 | 296 | var normalizedExpected = normalizeHTML(item.result); |
288 | 297 | if ( normalizedOut !== normalizedExpected ) { |
289 | | - printTitle(); |
| 298 | + printTitle( argv.quick ); |
290 | 299 | failOutputTests++; |
| 300 | + |
| 301 | + if( !argv.quick ) { |
291 | 302 | console.log('RAW EXPECTED'.cyan + ':'); |
292 | 303 | console.log(item.result + "\n"); |
293 | 304 | |
— | — | @@ -320,6 +331,7 @@ |
321 | 332 | //patch.replace(/^[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*\n/, '') |
322 | 333 | |
323 | 334 | console.log( colored_diff ); |
| 335 | + } |
324 | 336 | } else { |
325 | 337 | passedTests++; |
326 | 338 | if( !argv.quiet ) { |