Skip to content

Commit

Permalink
Fixup debugging in project panel tests
Browse files Browse the repository at this point in the history
  • Loading branch information
plemarquand committed Feb 20, 2025
1 parent dae9f7a commit 71434e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
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

0 comments on commit 71434e9

Please sign in to comment.