Skip to content

Commit 019ce55

Browse files
committed
Use dynamic lldb-dap path in tests
1 parent 0fd0dd3 commit 019ce55

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/integration-tests/testexplorer/TestExplorerIntegration.test.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
} from "../../../src/TestExplorer/TestUtils";
4444
import { runnableTag } from "../../../src/TestExplorer/TestDiscovery";
4545
import { Commands } from "../../../src/commands";
46+
import { SwiftToolchain } from "../../../src/toolchain/toolchain";
4647

4748
suite("Test Explorer Suite", function () {
4849
const MAX_TEST_RUN_TIME_MINUTES = 5;
@@ -95,10 +96,29 @@ suite("Test Explorer Suite", function () {
9596
});
9697

9798
suite("CodeLLDB", () => {
99+
async function getLLDBDebugAdapterPath() {
100+
switch (process.platform) {
101+
case "linux":
102+
return "/usr/lib/liblldb.so";
103+
case "win32":
104+
// eslint-disable-next-line no-case-declarations
105+
const toolchain = await SwiftToolchain.create();
106+
return await toolchain.getLLDBDebugAdapter();
107+
default:
108+
throw new Error("Please provide the path to lldb for this platform");
109+
}
110+
}
111+
98112
beforeEach(async function () {
113+
const lldbPath =
114+
process.env["CI"] === "1"
115+
? { "lldb.library": await getLLDBDebugAdapterPath() }
116+
: {};
117+
console.log(">>> LLDB PATH", lldbPath);
118+
99119
const testContext = await setupTestExplorerTest({
100120
"swift.debugger.useDebugAdapterFromToolchain": false,
101-
...(process.env["CI"] === "1" ? { "lldb.library": "/usr/lib/liblldb.so" } : {}),
121+
...lldbPath,
102122
});
103123

104124
workspaceContext = testContext.workspaceContext;

0 commit comments

Comments
 (0)