Skip to content

Commit fb7d741

Browse files
authored
Use correct xctest path when debugging on Windows (#972)
The windows debug config was delegating to the macOS debugging config, which runs xctests through a prebuilt executable included in the toolchain. On Windows, like Linux, an xctest executable is built during `swift test`/`swift build --build-tests`. This should be used instead. This patch brings the Windows config in line with what we do on Linux. Issue: #970
1 parent abf16cf commit fb7d741

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/debugger/buildConfig.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,15 @@ export class TestingDebugConfigurationFactory {
8888
}
8989

9090
switch (process.platform) {
91-
case "win32":
92-
return this.buildWindowsConfig();
9391
case "darwin":
9492
return this.buildDarwinConfg();
9593
default:
96-
return this.buildLinuxConfig();
94+
return this.buildNonDarwinConfig();
9795
}
9896
}
9997

10098
/* eslint-disable no-case-declarations */
101-
private buildLinuxConfig(): vscode.DebugConfiguration | null {
99+
private buildNonDarwinConfig(): vscode.DebugConfiguration | null {
102100
if (isDebugging(this.testKind) && this.testLibrary === TestLibrary.xctest) {
103101
return {
104102
...this.baseConfig,
@@ -107,7 +105,6 @@ export class TestingDebugConfigurationFactory {
107105
env: {
108106
...swiftRuntimeEnv(),
109107
...configuration.folder(this.ctx.workspaceFolder).testEnvironmentVariables,
110-
SWIFT_TESTING_ENABLED: "0",
111108
},
112109
};
113110
} else {
@@ -239,16 +236,6 @@ export class TestingDebugConfigurationFactory {
239236
}
240237
}
241238
}
242-
243-
private buildWindowsConfig(): vscode.DebugConfiguration | null {
244-
switch (this.testLibrary) {
245-
case TestLibrary.swiftTesting:
246-
// TODO: This is untested until rdar://128092675 is available in a windows SDK.
247-
return this.buildDarwinConfg();
248-
case TestLibrary.xctest:
249-
return this.buildDarwinConfg();
250-
}
251-
}
252239
/* eslint-enable no-case-declarations */
253240

254241
/**

0 commit comments

Comments
 (0)