@@ -235,14 +235,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
235235 cmd = cmd + sources . join ( " " ) ;
236236 console . log ( cmd + "\n" ) ;
237237
238- var ex = jake . createExec ( [ cmd ] ) ;
239- // Add listeners for output and error
240- ex . addListener ( "stdout" , function ( output ) {
241- process . stdout . write ( output ) ;
242- } ) ;
243- ex . addListener ( "stderr" , function ( error ) {
244- process . stderr . write ( error ) ;
245- } ) ;
238+ var ex = jake . createExec ( [ cmd ] , { interactive : true } ) ;
246239 ex . addListener ( "cmdEnd" , function ( ) {
247240 if ( ! useDebugMode && prefixes && fs . existsSync ( outFile ) ) {
248241 for ( var i in prefixes ) {
@@ -303,19 +296,10 @@ compileFile(processDiagnosticMessagesJs,
303296// The generated diagnostics map; built for the compiler and for the 'generate-diagnostics' task
304297file ( diagnosticInfoMapTs , [ processDiagnosticMessagesJs , diagnosticMessagesJson ] , function ( ) {
305298 var cmd = "node " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson ;
306- console . log ( cmd ) ;
307- var ex = jake . createExec ( [ cmd ] ) ;
308- // Add listeners for output and error
309- ex . addListener ( "stdout" , function ( output ) {
310- process . stdout . write ( output ) ;
311- } ) ;
312- ex . addListener ( "stderr" , function ( error ) {
313- process . stderr . write ( error ) ;
314- } ) ;
315- ex . addListener ( "cmdEnd" , function ( ) {
299+
300+ exec ( cmd , function ( ) {
316301 complete ( ) ;
317302 } ) ;
318- ex . run ( ) ;
319303} , { async : true } )
320304
321305desc ( "Generates a diagnostic file in TypeScript based on an input JSON file" ) ;
@@ -421,8 +405,8 @@ compileFile(word2mdJs,
421405file ( specMd , [ word2mdJs , specWord ] , function ( ) {
422406 var specWordFullPath = path . resolve ( specWord ) ;
423407 var cmd = "cscript //nologo " + word2mdJs + ' "' + specWordFullPath + '" ' + specMd ;
424- console . log ( cmd ) ;
425- child_process . exec ( cmd , function ( ) {
408+
409+ exec ( cmd , function ( ) {
426410 complete ( ) ;
427411 } ) ;
428412} , { async : true } )
@@ -476,19 +460,12 @@ desc("Builds the test infrastructure using the built compiler");
476460task ( "tests" , [ "local" , run ] . concat ( libraryTargets ) ) ;
477461
478462function exec ( cmd , completeHandler ) {
479- var ex = jake . createExec ( [ cmd ] , { windowsVerbatimArguments : true } ) ;
480- // Add listeners for output and error
481- ex . addListener ( "stdout" , function ( output ) {
482- process . stdout . write ( output ) ;
483- } ) ;
484- ex . addListener ( "stderr" , function ( error ) {
485- process . stderr . write ( error ) ;
486- } ) ;
463+ console . log ( cmd ) ;
464+ var ex = jake . createExec ( [ cmd ] , { windowsVerbatimArguments : true , interactive : true } ) ;
487465 ex . addListener ( "cmdEnd" , function ( ) {
488466 if ( completeHandler ) {
489467 completeHandler ( ) ;
490468 }
491- complete ( ) ;
492469 } ) ;
493470 ex . addListener ( "error" , function ( e , status ) {
494471 fail ( "Process exited with code " + status ) ;
@@ -509,7 +486,7 @@ function cleanTestDirs() {
509486 }
510487
511488 jake . mkdirP ( localRwcBaseline ) ;
512- jake . mkdirP ( localTest262Baseline ) ;
489+ jake . mkdirP ( localTest262Baseline ) ;
513490 jake . mkdirP ( localBaseline ) ;
514491}
515492
@@ -552,15 +529,17 @@ task("runtests", ["tests", builtLocalDirectory], function() {
552529 // timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
553530 // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
554531 var cmd = host + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run ;
555- console . log ( cmd ) ;
532+
556533 exec ( cmd , deleteTemporaryProjectOutput ) ;
557534} , { async : true } ) ;
558535
559536desc ( "Generates code coverage data via instanbul" )
560537task ( "generate-code-coverage" , [ "tests" , builtLocalDirectory ] , function ( ) {
561538 var cmd = 'istanbul cover node_modules/mocha/bin/_mocha -- -R min -t ' + testTimeout + ' ' + run ;
562- console . log ( cmd ) ;
563- exec ( cmd ) ;
539+
540+ exec ( cmd , function ( ) {
541+ complete ( ) ;
542+ } ) ;
564543} , { async : true } ) ;
565544
566545// Browser tests
@@ -571,7 +550,9 @@ compileFile(nodeServerOutFile, [nodeServerInFile], [builtLocalDirectory, tscFile
571550desc ( "Runs browserify on run.js to produce a file suitable for running tests in the browser" ) ;
572551task ( "browserify" , [ "tests" , builtLocalDirectory , nodeServerOutFile ] , function ( ) {
573552 var cmd = 'browserify built/local/run.js -o built/local/bundle.js' ;
574- exec ( cmd ) ;
553+ exec ( cmd , function ( ) {
554+ complete ( ) ;
555+ } ) ;
575556} , { async : true } ) ;
576557
577558desc ( "Runs the tests using the built run.js file like 'jake runtests'. Syntax is jake runtests-browser. Additional optional parameters tests=[regex], port=, browser=[chrome|IE]" ) ;
@@ -591,8 +572,9 @@ task("runtests-browser", ["tests", "browserify", builtLocalDirectory], function(
591572
592573 tests = tests ? tests : '' ;
593574 var cmd = host + " tests/webTestServer.js " + port + " " + browser + " " + tests
594- console . log ( cmd ) ;
595- exec ( cmd ) ;
575+ exec ( cmd , function ( ) {
576+ complete ( ) ;
577+ } ) ;
596578} , { async : true } ) ;
597579
598580function getDiffTool ( ) {
@@ -607,15 +589,17 @@ function getDiffTool() {
607589desc ( "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable" ) ;
608590task ( 'diff' , function ( ) {
609591 var cmd = '"' + getDiffTool ( ) + '" ' + refBaseline + ' ' + localBaseline ;
610- console . log ( cmd )
611- exec ( cmd ) ;
592+ exec ( cmd , function ( ) {
593+ complete ( ) ;
594+ } ) ;
612595} , { async : true } ) ;
613596
614597desc ( "Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable" ) ;
615598task ( 'diff-rwc' , function ( ) {
616599 var cmd = '"' + getDiffTool ( ) + '" ' + refRwcBaseline + ' ' + localRwcBaseline ;
617- console . log ( cmd )
618- exec ( cmd ) ;
600+ exec ( cmd , function ( ) {
601+ complete ( ) ;
602+ } ) ;
619603} , { async : true } ) ;
620604
621605desc ( "Builds the test sources and automation in debug mode" ) ;
@@ -676,14 +660,12 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
676660 jake . mkdirP ( temp ) ;
677661 var options = "--outdir " + temp + ' ' + loggedIOpath ;
678662 var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " " ;
679- console . log ( cmd + "\n" ) ;
680- var ex = jake . createExec ( [ cmd ] ) ;
681- ex . addListener ( "cmdEnd" , function ( ) {
663+
664+ exec ( cmd , function ( ) {
682665 fs . renameSync ( temp + '/harness/loggedIO.js' , loggedIOJsPath ) ;
683666 jake . rmRf ( temp ) ;
684667 complete ( ) ;
685668 } ) ;
686- ex . run ( ) ;
687669} , { async : true } ) ;
688670
689671var instrumenterPath = harnessDirectory + 'instrumenter.ts' ;
@@ -693,10 +675,8 @@ compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath],
693675desc ( "Builds an instrumented tsc.js" ) ;
694676task ( 'tsc-instrumented' , [ loggedIOJsPath , instrumenterJsPath , tscFile ] , function ( ) {
695677 var cmd = host + ' ' + instrumenterJsPath + ' record iocapture ' + builtLocalDirectory + compilerFilename ;
696- console . log ( cmd ) ;
697- var ex = jake . createExec ( [ cmd ] ) ;
698- ex . addListener ( "cmdEnd" , function ( ) {
678+
679+ exec ( cmd , function ( ) {
699680 complete ( ) ;
700681 } ) ;
701- ex . run ( ) ;
702682} , { async : true } ) ;
0 commit comments