Skip to content

Commit 4d9d401

Browse files
committed
test/integration/goDebug: enable set cwd tests for dlv dap
Enable the working directory tests for dlv dap. This also copies the value of the "cwd" attribute in the launch config to "wd", since that is the attribute expected by dlv dap. Change-Id: If451f5d55fa43275490407d2138d4326a558e63b Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/305532 Trust: Suzy Mueller <[email protected]> Run-TryBot: Suzy Mueller <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent 8d0bd24 commit 4d9d401

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/goDebugConfiguration.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr
254254
dlvDAPVersionCurrent = true;
255255
}
256256

257+
if (debugAdapter === 'dlv-dap' && debugConfiguration['cwd']) {
258+
// dlv dap expects 'wd' not 'cwd'
259+
debugConfiguration['wd'] = debugConfiguration['cwd'];
260+
}
261+
257262
if (debugConfiguration['mode'] === 'auto') {
258263
debugConfiguration['mode'] =
259264
activeEditor && activeEditor.document.fileName.endsWith('_test.go') ? 'test' : 'debug';

src/goInstallTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ export function declinedToolInstall(toolName: string) {
308308
const tool = getTool(toolName);
309309

310310
// If user has declined to install this tool, don't prompt for it.
311-
return !!containsTool(declinedInstalls, tool)
311+
return !!containsTool(declinedInstalls, tool);
312312
}
313313

314314
export async function promptForMissingTool(toolName: string) {

test/integration/goDebug.test.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,7 @@ const testAll = (isDlvDap: boolean) => {
692692
});
693693

694694
suite('set current working directory', () => {
695-
test('should debug program with cwd set', async function () {
696-
if (isDlvDap && dlvDapSkipsEnabled) {
697-
this.skip(); // Fixed in https://github.com/go-delve/delve/pull/2360
698-
}
699-
695+
test('should debug program with cwd set', async () => {
700696
const WD = path.join(DATA_ROOT, 'cwdTest');
701697
const PROGRAM = path.join(WD, 'cwdTest');
702698
const FILE = path.join(PROGRAM, 'main.go');
@@ -735,11 +731,7 @@ const testAll = (isDlvDap: boolean) => {
735731
await assertLocalVariableValue('strdat', '"Goodbye, World."');
736732
});
737733

738-
test('should debug file program with cwd set', async function () {
739-
if (isDlvDap && dlvDapSkipsEnabled) {
740-
this.skip(); // Fixed in https://github.com/go-delve/delve/pull/2360
741-
}
742-
734+
test('should debug file program with cwd set', async () => {
743735
const WD = path.join(DATA_ROOT, 'cwdTest');
744736
const PROGRAM = path.join(WD, 'cwdTest', 'main.go');
745737
const FILE = PROGRAM;
@@ -1805,6 +1797,8 @@ const testAll = (isDlvDap: boolean) => {
18051797

18061798
async function initializeDebugConfig(config: DebugConfiguration) {
18071799
if (isDlvDap) {
1800+
config['debugAdapter'] = 'dlv-dap';
1801+
// Log the output for easier test debugging.
18081802
config['logOutput'] = 'dap';
18091803
config['showLog'] = true;
18101804
}

0 commit comments

Comments
 (0)