1
-
2
1
require . paths . unshift ( __dirname + '/../lib/' ) ;
3
2
4
3
Client = require ( 'client' ) ;
@@ -101,14 +100,6 @@ assert.isNull = function(item, message) {
101
100
assert . ok ( item === null , message ) ;
102
101
} ;
103
102
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
-
112
103
test = function ( name , action ) {
113
104
test . testCount ++ ;
114
105
var result = action ( ) ;
@@ -120,26 +111,35 @@ test = function(name, action) {
120
111
}
121
112
} ;
122
113
123
- test . assertCount = test . assertCount || 0 ;
114
+ //print out the filename
115
+ process . stdout . write ( require ( 'path' ) . basename ( process . argv [ 1 ] ) ) ;
116
+
124
117
test . testCount = test . testCount || 0 ;
125
118
test . ignored = test . ignored || [ ] ;
126
119
test . errors = test . errors || [ ] ;
127
- test . start = test . start || new Date ( ) ;
128
120
129
121
process . on ( 'exit' , function ( ) {
130
122
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
+ }
139
132
test . errors . forEach ( function ( error ) {
140
133
throw error . e ;
141
134
} ) ;
142
135
} ) ;
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
+
143
143
var count = 0 ;
144
144
145
145
var Sink = function ( expected , timeout , callback ) {
0 commit comments