Skip to content

Commit dd9f67e

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

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

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

Lines changed: 24 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,32 @@ 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+
return await (await SwiftToolchain.create()).getLLDBDebugAdapter();
105+
default:
106+
throw new Error("Please provide the path to lldb for this platform");
107+
}
108+
}
109+
98110
beforeEach(async function () {
111+
// CodeLLDB on windows doesn't print output and so cannot be parsed
112+
if (process.platform === "win32") {
113+
this.skip();
114+
return;
115+
}
116+
117+
const lldbPath =
118+
process.env["CI"] === "1"
119+
? { "lldb.library": await getLLDBDebugAdapterPath() }
120+
: {};
121+
99122
const testContext = await setupTestExplorerTest({
100123
"swift.debugger.useDebugAdapterFromToolchain": false,
101-
...(process.env["CI"] === "1" ? { "lldb.library": "/usr/lib/liblldb.so" } : {}),
124+
...lldbPath,
102125
});
103126

104127
workspaceContext = testContext.workspaceContext;

0 commit comments

Comments
 (0)