Skip to content

Use correct xctest path when debugging on Windows #972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions src/debugger/buildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,15 @@ export class TestingDebugConfigurationFactory {
}

switch (process.platform) {
case "win32":
return this.buildWindowsConfig();
case "darwin":
return this.buildDarwinConfg();
default:
return this.buildLinuxConfig();
return this.buildNonDarwinConfig();
}
}

/* eslint-disable no-case-declarations */
private buildLinuxConfig(): vscode.DebugConfiguration | null {
private buildNonDarwinConfig(): vscode.DebugConfiguration | null {
if (isDebugging(this.testKind) && this.testLibrary === TestLibrary.xctest) {
return {
...this.baseConfig,
Expand All @@ -107,7 +105,6 @@ export class TestingDebugConfigurationFactory {
env: {
...swiftRuntimeEnv(),
...configuration.folder(this.ctx.workspaceFolder).testEnvironmentVariables,
SWIFT_TESTING_ENABLED: "0",
},
};
} else {
Expand Down Expand Up @@ -239,16 +236,6 @@ export class TestingDebugConfigurationFactory {
}
}
}

private buildWindowsConfig(): vscode.DebugConfiguration | null {
switch (this.testLibrary) {
case TestLibrary.swiftTesting:
// TODO: This is untested until rdar://128092675 is available in a windows SDK.
return this.buildDarwinConfg();
case TestLibrary.xctest:
return this.buildDarwinConfg();
}
}
/* eslint-enable no-case-declarations */

/**
Expand Down