1-
21require . paths . unshift ( __dirname + '/../lib/' ) ;
32
43Client = require ( 'client' ) ;
@@ -101,14 +100,6 @@ assert.isNull = function(item, message) {
101100 assert . ok ( item === null , message ) ;
102101} ;
103102
104- [ 'equal' , 'length' , 'empty' , 'strictEqual' , 'emits' , 'equalBuffers' , 'same' , 'calls' , 'ok' ] . forEach ( function ( name ) {
105- var old = assert [ name ] ;
106- assert [ name ] = function ( ) {
107- test . assertCount ++
108- return old . apply ( this , arguments ) ;
109- } ;
110- } ) ;
111-
112103test = function ( name , action ) {
113104 test . testCount ++ ;
114105 var result = action ( ) ;
@@ -120,26 +111,35 @@ test = function(name, action) {
120111 }
121112} ;
122113
123- test . assertCount = test . assertCount || 0 ;
114+ //print out the filename
115+ process . stdout . write ( require ( 'path' ) . basename ( process . argv [ 1 ] ) ) ;
116+
124117test . testCount = test . testCount || 0 ;
125118test . ignored = test . ignored || [ ] ;
126119test . errors = test . errors || [ ] ;
127- test . start = test . start || new Date ( ) ;
128120
129121process . on ( 'exit' , function ( ) {
130122 console . log ( '' ) ;
131- var duration = ( ( new Date ( ) - test . start ) / 1000 ) ;
132- console . log ( test . testCount + ' tests ' + test . assertCount + ' assertions in ' + duration + ' seconds' ) ;
133- test . ignored . forEach ( function ( name ) {
134- console . log ( "Ignored: " + name ) ;
135- } ) ;
136- test . errors . forEach ( function ( error ) {
137- console . log ( "Error: " + error . name ) ;
138- } ) ;
123+ if ( test . ignored . length || test . errors . length ) {
124+ test . ignored . forEach ( function ( name ) {
125+ console . log ( "Ignored: " + name ) ;
126+ } ) ;
127+ test . errors . forEach ( function ( error ) {
128+ console . log ( "Error: " + error . name ) ;
129+ } ) ;
130+ console . log ( '' ) ;
131+ }
139132 test . errors . forEach ( function ( error ) {
140133 throw error . e ;
141134 } ) ;
142135} ) ;
136+
137+ process . on ( 'uncaughtException' , function ( err ) {
138+ console . error ( "\n %s" , err . stack || err . toString ( ) )
139+ //causes xargs to abort right away
140+ process . exit ( 255 ) ;
141+ } ) ;
142+
143143var count = 0 ;
144144
145145var Sink = function ( expected , timeout , callback ) {
0 commit comments