22import * as path from 'path' ;
33import { execPythonFile } from './../../common/utils' ;
44import { createDeferred , createTemporaryFile } from '../../common/helpers' ;
5- import { OutputChannel , window } from 'vscode' ;
5+ import { OutputChannel , window , CancellationToken } from 'vscode' ;
66import { TestFile , TestsToRun , TestSuite , TestFunction , FlattenedTestFunction , Tests , TestStatus , FlattenedTestSuite } from '../common/contracts' ;
77import * as vscode from 'vscode' ;
88import { extractBetweenDelimiters , convertFileToPackage , flattenTestFiles , updateResults } from '../common/testUtils' ;
99import { BaseTestManager } from '../common/baseTestManager' ;
10- import { CancellationToken } from 'vscode' ;
1110import { updateResultsFromXmlLogFile , PassCalculationFormulae } from '../common/xUnitParser' ;
11+ import { run } from '../common/runner' ;
1212
13- export function runTest ( rootDirectory : string , tests : Tests , args : string [ ] , testsToRun ?: TestsToRun , stdOut ?: ( output : string ) => void , token ?: CancellationToken ) : Promise < any > {
13+ export function runTest ( rootDirectory : string , tests : Tests , args : string [ ] , testsToRun ?: TestsToRun , token ?: CancellationToken , outChannel ?: OutputChannel ) : Promise < any > {
1414 let testPaths = [ ] ;
1515 if ( testsToRun && testsToRun . testFolder ) {
1616 testPaths = testPaths . concat ( testsToRun . testFolder . map ( f => f . nameToRun ) ) ;
@@ -31,7 +31,7 @@ export function runTest(rootDirectory: string, tests: Tests, args: string[], tes
3131 return createTemporaryFile ( '.xml' ) . then ( xmlLogResult => {
3232 xmlLogFile = xmlLogResult . filePath ;
3333 xmlLogFileCleanup = xmlLogResult . cleanupCallback ;
34- return execPythonFile ( 'nosetests' , args . concat ( [ '--with-xunit' , `--xunit-file=${ xmlLogFile } ` ] ) . concat ( testPaths ) , rootDirectory , true , stdOut ) ;
34+ return run ( 'nosetests' , args . concat ( [ '--with-xunit' , `--xunit-file=${ xmlLogFile } ` ] ) . concat ( testPaths ) , rootDirectory , token , outChannel ) ;
3535 } ) . then ( ( ) => {
3636 return updateResultsFromLogFiles ( tests , xmlLogFile ) ;
3737 } ) . then ( result => {
0 commit comments