Skip to content
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

Project Panel #1382

Merged
merged 9 commits into from
Feb 27, 2025
Prev Previous commit
Next Next commit
Fixup debugging in project panel tests
  • Loading branch information
plemarquand committed Feb 21, 2025
commit 301cc6717838f846756a12cce42a940b0018d987
6 changes: 1 addition & 5 deletions assets/test/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@
"-DTEST_ARGUMENT_SET_VIA_TEST_BUILD_ARGUMENTS_SETTING"
],
"lldb.verboseLogging": true,
"swift.backgroundCompilation": false,
"swift.debugger.useDebugAdapterFromToolchain": false,
"lldb.library": "/usr/lib/liblldb.so",
"lldb.launch.expressions": "native",
"swift.pluginPermissions": {}
"swift.backgroundCompilation": false
}
3 changes: 2 additions & 1 deletion src/SwiftSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ export async function debugSnippetWithOptions(
ctx.buildFinished(snippetName, snippetDebugConfig, options);
return result;
});
} catch {
} catch (error) {
ctx.outputChannel.appendLine(`Failed to debug snippet: ${error}`);
// ignore error if task failed to run
return false;
}
Expand Down
21 changes: 1 addition & 20 deletions test/integration-tests/ui/ProjectPanelProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import {
updateSettings,
} from "../utilities/testutilities";
import contextKeys from "../../../src/contextKeys";
import { SwiftToolchain } from "../../../src/toolchain/toolchain";
import { getLLDBLibPath } from "../../../src/debugger/lldb";

suite("ProjectPanelProvider Test Suite", function () {
let treeProvider: ProjectPanelProvider;
Expand All @@ -53,27 +51,10 @@ suite("ProjectPanelProvider Test Suite", function () {
testAssets: ["targets"],
});

async function getLLDBDebugAdapterPath() {
switch (process.platform) {
case "linux":
return "/usr/lib/liblldb.so";
case "win32":
return await (await SwiftToolchain.create()).getLLDBDebugAdapter();
default:
return (await getLLDBLibPath(await SwiftToolchain.create())).success;
}
}

let resetSettings: (() => Promise<void>) | undefined;
beforeEach(async function () {
const lldbPath = {
"lldb.library": await getLLDBDebugAdapterPath(),
"lldb.launch.expressions": "native",
};

resetSettings = await updateSettings({
"swift.debugger.useDebugAdapterFromToolchain": false,
...lldbPath,
"swift.debugger.debugAdapter": "CodeLLDB",
});

await waitForNoRunningTasks();
Expand Down