@@ -43,6 +43,7 @@ import {
4343} from "../../../src/TestExplorer/TestUtils" ;
4444import { runnableTag } from "../../../src/TestExplorer/TestDiscovery" ;
4545import { Commands } from "../../../src/commands" ;
46+ import { SwiftToolchain } from "../../../src/toolchain/toolchain" ;
4647
4748suite ( "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