@@ -88,15 +88,39 @@ export class DebugConfigurationFactory {
88
88
switch ( process . platform ) {
89
89
case "win32" :
90
90
return this . buildWindowsConfig ( ) ;
91
- default :
91
+ case "darwin" :
92
92
return this . buildDarwinConfg ( ) ;
93
+ default :
94
+ return this . buildLinuxConfig ( ) ;
93
95
}
94
96
}
95
97
96
98
/* eslint-disable no-case-declarations */
99
+ private buildLinuxConfig ( ) : vscode . DebugConfiguration | null {
100
+ if ( this . testKind === TestKind . debug && this . testLibrary === TestLibrary . xctest ) {
101
+ const { folder } = getFolderAndNameSuffix ( this . ctx , this . expandEnvVariables ) ;
102
+ const buildDirectory = BuildFlags . buildDirectoryFromWorkspacePath ( folder , true ) ;
103
+ return {
104
+ ...this . baseConfig ,
105
+ program : path . join (
106
+ buildDirectory ,
107
+ "debug" ,
108
+ this . ctx . swiftPackage . name + "PackageTests.xctest"
109
+ ) ,
110
+ args : this . testList ,
111
+ env : {
112
+ ...swiftRuntimeEnv ( ) ,
113
+ ...configuration . folder ( this . ctx . workspaceFolder ) . testEnvironmentVariables ,
114
+ } ,
115
+ } ;
116
+ } else {
117
+ return this . buildDarwinConfg ( ) ;
118
+ }
119
+ }
120
+
97
121
private buildDarwinConfg ( ) : vscode . DebugConfiguration | null {
98
122
switch ( this . testLibrary ) {
99
- case "swift-testing" :
123
+ case TestLibrary . swiftTesting :
100
124
switch ( this . testKind ) {
101
125
case TestKind . debug :
102
126
// In the debug case we need to build the .swift-testing executable and then
@@ -158,7 +182,7 @@ export class DebugConfigurationFactory {
158
182
: this . baseConfig . preLaunchTask ,
159
183
} ;
160
184
}
161
- case "XCTest" :
185
+ case TestLibrary . xctest :
162
186
switch ( this . testKind ) {
163
187
case TestKind . debug :
164
188
const xcTestPath = this . ctx . workspaceContext . toolchain . xcTestPath ;
@@ -238,8 +262,6 @@ export class DebugConfigurationFactory {
238
262
: this . baseConfig . preLaunchTask ,
239
263
} ;
240
264
}
241
- default :
242
- return null ;
243
265
}
244
266
}
245
267
0 commit comments