@@ -626,9 +626,7 @@ function deleteTemporaryProjectOutput() {
626
626
}
627
627
}
628
628
629
- var testTimeout = 20000 ;
630
- desc ( "Runs the tests using the built run.js file. Syntax is jake runtests. Optional parameters 'host=', 'tests=[regex], reporter=[list|spec|json|<more>]', debug=true." ) ;
631
- task ( "runtests" , [ "build-rules" , "tests" , builtLocalDirectory ] , function ( ) {
629
+ function runConsoleTests ( defaultReporter , defaultSubsets , postLint ) {
632
630
cleanTestDirs ( ) ;
633
631
var debug = process . env . debug || process . env . d ;
634
632
tests = process . env . test || process . env . tests || process . env . t ;
@@ -638,7 +636,7 @@ task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
638
636
fs . unlinkSync ( testConfigFile ) ;
639
637
}
640
638
641
- if ( tests || light ) {
639
+ if ( tests || light ) {
642
640
writeTestConfigFile ( tests , light , testConfigFile ) ;
643
641
}
644
642
@@ -648,20 +646,48 @@ task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
648
646
649
647
colors = process . env . colors || process . env . color
650
648
colors = colors ? ' --no-colors ' : ' --colors ' ;
651
- tests = tests ? ' -g ' + tests : '' ;
652
- reporter = process . env . reporter || process . env . r || 'mocha-fivemat-progress-reporter' ;
649
+ reporter = process . env . reporter || process . env . r || defaultReporter ;
650
+
653
651
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
654
652
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
655
- var cmd = "mocha" + ( debug ? " --debug-brk" : "" ) + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run ;
656
- console . log ( cmd ) ;
657
- exec ( cmd , function ( ) {
658
- deleteTemporaryProjectOutput ( ) ;
659
- var lint = jake . Task [ 'lint' ] ;
660
- lint . addListener ( 'complete' , function ( ) {
661
- complete ( ) ;
653
+ var subsetRegexes ;
654
+ if ( defaultSubsets . length === 0 ) {
655
+ subsetRegexes = [ tests ]
656
+ }
657
+ else {
658
+ var subsets = tests ? tests . split ( "|" ) : defaultSubsets ;
659
+ subsetRegexes = subsets . map ( function ( sub ) { return "^" + sub + ".*$" ; } ) ;
660
+ subsetRegexes . push ( "^(?!" + subsets . join ( "|" ) + ").*$" ) ;
661
+ }
662
+ subsetRegexes . forEach ( function ( subsetRegex ) {
663
+ tests = subsetRegex ? ' -g "' + subsetRegex + '"' : '' ;
664
+ var cmd = "mocha" + ( debug ? " --debug-brk" : "" ) + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run ;
665
+ console . log ( cmd ) ;
666
+ exec ( cmd , function ( ) {
667
+ deleteTemporaryProjectOutput ( ) ;
668
+ if ( postLint ) {
669
+ var lint = jake . Task [ 'lint' ] ;
670
+ lint . addListener ( 'complete' , function ( ) {
671
+ complete ( ) ;
672
+ } ) ;
673
+ lint . invoke ( ) ;
674
+ }
675
+ else {
676
+ complete ( ) ;
677
+ }
662
678
} ) ;
663
- lint . invoke ( ) ;
664
679
} ) ;
680
+ }
681
+
682
+ var testTimeout = 20000 ;
683
+ desc ( "Runs all the tests in parallel using the built run.js file. Optional arguments are: t[ests]=category1|category2|... d[ebug]=true." ) ;
684
+ task ( "runtests-parallel" , [ "build-rules" , "tests" , builtLocalDirectory ] , function ( ) {
685
+ runConsoleTests ( 'min' , [ 'compiler' , 'conformance' , 'Projects' , 'fourslash' ] ) ;
686
+ } , { async : true } ) ;
687
+
688
+ desc ( "Runs the tests using the built run.js file. Optional arguments are: t[ests]=regex r[eporter]=[list|spec|json|<more>] d[ebug]=true color[s]=false." ) ;
689
+ task ( "runtests" , [ "build-rules" , "tests" , builtLocalDirectory ] , function ( ) {
690
+ runConsoleTests ( 'mocha-fivemat-progress-reporter' , [ ] , /*postLint*/ true ) ;
665
691
} , { async : true } ) ;
666
692
667
693
desc ( "Generates code coverage data via instanbul" ) ;
@@ -820,7 +846,8 @@ var tslintRuleDir = "scripts/tslint";
820
846
var tslintRules = ( [
821
847
"nextLineRule" ,
822
848
"noNullRule" ,
823
- "booleanTriviaRule"
849
+ "booleanTriviaRule" ,
850
+ "typeOperatorSpacingRule"
824
851
] ) ;
825
852
var tslintRulesFiles = tslintRules . map ( function ( p ) {
826
853
return path . join ( tslintRuleDir , p + ".ts" ) ;
0 commit comments