r104704 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104703‎ | r104704 | r104705 >
Date:17:18, 30 November 2011
Author:hashar
Status:deferred
Tags:
Comment:
--quick Suppress diff output of failed tests

A long block of code was not reindented to make this patch easier
to read for people not ignoring white spaces changes :D
Modified paths:
  • /trunk/extensions/VisualEditor/tests/parser/parserTests.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js
@@ -24,6 +24,11 @@
2525 var optimist = require('optimist');
2626
2727 var argv = optimist.usage( 'Usage: $0', {
 28+ 'quick': {
 29+ description: 'Suppress diff output of failed tests',
 30+ boolean: true,
 31+ default: false,
 32+ },
2833 'quiet': {
2934 description: 'Suppress notification of passed tests (shows only failed tests)',
3035 boolean: true,
@@ -240,7 +245,11 @@
241246 throw new Error('Missing input from test case ' + item.title);
242247 }
243248
244 - function printTitle() {
 249+ function printTitle( failure_only ) {
 250+ if( failure_only ) {
 251+ console.log('FAILED'.red + ': ' + item.title.yellow);
 252+ return;
 253+ }
245254 console.log('=====================================================');
246255 console.log('FAILED'.red + ': ' + item.title.yellow);
247256 console.log(item.comments.join('\n'));
@@ -285,8 +294,10 @@
286295 var normalizedOut = normalizeOut(out);
287296 var normalizedExpected = normalizeHTML(item.result);
288297 if ( normalizedOut !== normalizedExpected ) {
289 - printTitle();
 298+ printTitle( argv.quick );
290299 failOutputTests++;
 300+
 301+ if( !argv.quick ) {
291302 console.log('RAW EXPECTED'.cyan + ':');
292303 console.log(item.result + "\n");
293304
@@ -320,6 +331,7 @@
321332 //patch.replace(/^[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*\n/, '')
322333
323334 console.log( colored_diff );
 335+ }
324336 } else {
325337 passedTests++;
326338 if( !argv.quiet ) {

Status & tagging log