14
14
15
15
import * as vscode from "vscode" ;
16
16
import { expect } from "chai" ;
17
- import {
18
- LLDBDebugAdapterExecutableFactory ,
19
- LLDBDebugConfigurationProvider ,
20
- } from "../../../src/debugger/debugAdapterFactory" ;
17
+ import { LLDBDebugConfigurationProvider } from "../../../src/debugger/debugAdapterFactory" ;
21
18
import { Version } from "../../../src/utilities/version" ;
22
19
import {
23
20
mockGlobalObject ,
@@ -28,46 +25,14 @@ import {
28
25
mockFn ,
29
26
} from "../../MockUtils" ;
30
27
import * as mockFS from "mock-fs" ;
31
- import {
32
- DebugAdapter ,
33
- LaunchConfigType ,
34
- SWIFT_LAUNCH_CONFIG_TYPE ,
35
- } from "../../../src/debugger/debugAdapter" ;
28
+ import { LaunchConfigType , SWIFT_LAUNCH_CONFIG_TYPE } from "../../../src/debugger/debugAdapter" ;
36
29
import * as lldb from "../../../src/debugger/lldb" ;
37
30
import { SwiftToolchain } from "../../../src/toolchain/toolchain" ;
38
31
import { SwiftOutputChannel } from "../../../src/ui/SwiftOutputChannel" ;
39
32
import * as debugAdapter from "../../../src/debugger/debugAdapter" ;
40
33
import { Result } from "../../../src/utilities/result" ;
41
34
import configuration from "../../../src/configuration" ;
42
35
43
- suite ( "LLDBDebugAdapterExecutableFactory Tests" , ( ) => {
44
- const mockDebugAdapter = mockGlobalModule ( DebugAdapter ) ;
45
- let mockToolchain : MockedObject < SwiftToolchain > ;
46
- let mockOutputChannel : MockedObject < SwiftOutputChannel > ;
47
-
48
- setup ( ( ) => {
49
- mockToolchain = mockObject < SwiftToolchain > ( { } ) ;
50
- mockOutputChannel = mockObject < SwiftOutputChannel > ( {
51
- log : mockFn ( ) ,
52
- } ) ;
53
- } ) ;
54
-
55
- test ( "should return a DebugAdapterExecutable with the path to lldb-dap" , async ( ) => {
56
- const toolchainPath = "/path/to/debug/adapter" ;
57
-
58
- mockDebugAdapter . getLLDBDebugAdapterPath . resolves ( toolchainPath ) ;
59
-
60
- const factory = new LLDBDebugAdapterExecutableFactory (
61
- instance ( mockToolchain ) ,
62
- instance ( mockOutputChannel )
63
- ) ;
64
- const result = await factory . createDebugAdapterDescriptor ( ) ;
65
-
66
- expect ( result ) . to . be . instanceOf ( vscode . DebugAdapterExecutable ) ;
67
- expect ( result ) . to . have . property ( "command" ) . that . equals ( toolchainPath ) ;
68
- } ) ;
69
- } ) ;
70
-
71
36
suite ( "LLDBDebugConfigurationProvider Tests" , ( ) => {
72
37
let mockToolchain : MockedObject < SwiftToolchain > ;
73
38
let mockOutputChannel : MockedObject < SwiftOutputChannel > ;
@@ -188,7 +153,10 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
188
153
request : "launch" ,
189
154
program : "${workspaceFolder}/.build/debug/executable" ,
190
155
} ) ;
191
- expect ( launchConfig ) . to . containSubset ( { type : LaunchConfigType . LLDB_DAP } ) ;
156
+ expect ( launchConfig ) . to . containSubset ( {
157
+ type : LaunchConfigType . LLDB_DAP ,
158
+ debugAdapterExecutable : "/path/to/lldb-dap" ,
159
+ } ) ;
192
160
} ) ;
193
161
194
162
test ( "fails if the path to lldb-dap could not be found" , async ( ) => {
0 commit comments