@@ -8,6 +8,17 @@ import * as path from 'path';
88import { runTests } from 'vscode-test' ;
99import { execChildProcess } from '../src/common' ;
1010
11+ function getSln ( workspacePath : string ) : string | undefined {
12+ if ( workspacePath . endsWith ( "slnWithCsproj" ) ) {
13+ return "b_SecondInOrder_SlnFile.sln" ;
14+ }
15+ else if ( workspacePath . endsWith ( "slnFilterWithCsproj" ) ) {
16+ return "SolutionFile.sln" ;
17+ }
18+
19+ return undefined ;
20+ }
21+
1122async function main ( ) {
1223 try {
1324 // The folder containing the Extension Manifest package.json
@@ -29,9 +40,12 @@ async function main() {
2940
3041 console . log ( `workspace path = '${ workspacePath } '` ) ;
3142
32- // Run a build before the tests, to ensure that source generators are set up correctly
33- const dotnetPath = path . join ( process . env . DOTNET_ROOT , 'dotnet' ) ;
34- await execChildProcess ( `${ dotnetPath } build` , workspacePath ) ;
43+ const sln = getSln ( workspacePath ) ;
44+ if ( sln ) {
45+ // Run a build before the tests, to ensure that source generators are set up correctly
46+ const dotnetPath = path . join ( process . env . DOTNET_ROOT , 'dotnet' ) ;
47+ await execChildProcess ( `${ dotnetPath } build ${ sln } ` , workspacePath ) ;
48+ }
3549
3650 // Download VS Code, unzip it and run the integration test
3751 await runTests ( { extensionDevelopmentPath, extensionTestsPath, launchArgs : [ workspacePath , '-n' , '--verbose' ] , extensionTestsEnv : process . env } ) ;
0 commit comments