@@ -726,24 +726,40 @@ function runConsoleTests(defaultReporter, defaultSubsets) {
726726 subsetRegexes = subsets . map ( function ( sub ) { return "^" + sub + ".*$" ; } ) ;
727727 subsetRegexes . push ( "^(?!" + subsets . join ( "|" ) + ").*$" ) ;
728728 }
729+ var counter = subsetRegexes . length ;
730+ var errorStatus ;
729731 subsetRegexes . forEach ( function ( subsetRegex , i ) {
730732 tests = subsetRegex ? ' -g "' + subsetRegex + '"' : '' ;
731733 var cmd = "mocha" + ( debug ? " --debug-brk" : "" ) + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run ;
732734 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+
734742 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+ }
736757 }
737758 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- }
745759 finish ( ) ;
746- } , finish ) ;
760+ } , function ( e , status ) {
761+ finish ( status ) ;
762+ } ) ;
747763 } ) ;
748764}
749765
@@ -962,36 +978,30 @@ function lintFileAsync(options, path, cb) {
962978 } ) ;
963979}
964980
965- var servicesLintTargets = [
966- "navigateTo.ts" ,
967- "navigationBar.ts" ,
968- "outliningElementsCollector.ts" ,
969- "patternMatcher.ts" ,
970- "services.ts" ,
971- "shims.ts" ,
972- "jsTyping.ts"
973- ] . map ( function ( s ) {
974- return path . join ( servicesDirectory , s ) ;
975- } ) ;
976981var lintTargets = compilerSources
977- . concat ( harnessCoreSources )
982+ . concat ( harnessSources )
983+ // Other harness sources
984+ . concat ( [ "instrumenter.ts" ] . map ( function ( f ) { return path . join ( harnessDirectory , f ) } ) )
978985 . concat ( serverCoreSources )
979986 . concat ( tslintRulesFiles )
980- . concat ( servicesLintTargets ) ;
987+ . concat ( servicesSources ) ;
988+
981989
982990desc ( "Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex" ) ;
983991task ( "lint" , [ "build-rules" ] , function ( ) {
984992 var lintOptions = getLinterOptions ( ) ;
985993 var failed = 0 ;
986994 var fileMatcher = RegExp ( process . env . f || process . env . file || process . env . files || "" ) ;
995+ var done = { } ;
987996 for ( var i in lintTargets ) {
988997 var target = lintTargets [ i ] ;
989- if ( fileMatcher . test ( target ) ) {
998+ if ( ! done [ target ] && fileMatcher . test ( target ) ) {
990999 var result = lintFile ( lintOptions , target ) ;
9911000 if ( result . failureCount > 0 ) {
9921001 console . log ( result . output ) ;
9931002 failed += result . failureCount ;
9941003 }
1004+ done [ target ] = true ;
9951005 }
9961006 }
9971007 if ( failed > 0 ) {
0 commit comments