File tree Expand file tree Collapse file tree 1 file changed +26
-10
lines changed Expand file tree Collapse file tree 1 file changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -726,24 +726,40 @@ function runConsoleTests(defaultReporter, defaultSubsets) {
726
726
subsetRegexes = subsets . map ( function ( sub ) { return "^" + sub + ".*$" ; } ) ;
727
727
subsetRegexes . push ( "^(?!" + subsets . join ( "|" ) + ").*$" ) ;
728
728
}
729
+ var counter = subsetRegexes . length ;
730
+ var errorStatus ;
729
731
subsetRegexes . forEach ( function ( subsetRegex , i ) {
730
732
tests = subsetRegex ? ' -g "' + subsetRegex + '"' : '' ;
731
733
var cmd = "mocha" + ( debug ? " --debug-brk" : "" ) + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run ;
732
734
console . log ( cmd ) ;
733
- function finish ( ) {
735
+ function finish ( status ) {
736
+ counter -- ;
737
+ // save first error status
738
+ if ( status !== undefined && errorStatus === undefined ) {
739
+ errorStatus = status ;
740
+ }
741
+
734
742
deleteTemporaryProjectOutput ( ) ;
735
- complete ( ) ;
743
+ if ( counter !== 0 || errorStatus === undefined ) {
744
+ // run linter when last worker is finished
745
+ if ( lintFlag && counter === 0 ) {
746
+ var lint = jake . Task [ 'lint' ] ;
747
+ lint . addListener ( 'complete' , function ( ) {
748
+ complete ( ) ;
749
+ } ) ;
750
+ lint . invoke ( ) ;
751
+ }
752
+ complete ( ) ;
753
+ }
754
+ else {
755
+ fail ( "Process exited with code " + status ) ;
756
+ }
736
757
}
737
758
exec ( cmd , function ( ) {
738
- if ( lintFlag && i === 0 ) {
739
- var lint = jake . Task [ 'lint' ] ;
740
- lint . addListener ( 'complete' , function ( ) {
741
- complete ( ) ;
742
- } ) ;
743
- lint . invoke ( ) ;
744
- }
745
759
finish ( ) ;
746
- } , finish ) ;
760
+ } , function ( e , status ) {
761
+ finish ( status ) ;
762
+ } ) ;
747
763
} ) ;
748
764
}
749
765
You can’t perform that action at this time.
0 commit comments