Skip to content

Commit d5c8951

Browse files
committed
test/integration/goDebug: enable noDebug tests for dlv dap
The PR to add noDebug support has been merged and noDebug is now supported in dlv dap. Change-Id: I1dc47c7ad70c4e994509e1b80f42f2dbe0e3e7df Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/309089 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 44b7d36 commit d5c8951

File tree

1 file changed

+28
-44
lines changed

1 file changed

+28
-44
lines changed

test/integration/goDebug.test.ts

+28-44
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
775775
await assertLocalVariableValue('strdat', '"Goodbye, World."');
776776
});
777777

778-
test('should run program with cwd set (noDebug)', async function () {
779-
if (isDlvDap && dlvDapSkipsEnabled) {
780-
this.skip(); // OutputEvents not implemented
781-
}
782-
778+
test('should run program with cwd set (noDebug)', async () => {
783779
const WD = path.join(DATA_ROOT, 'cwdTest');
784780
const PROGRAM = path.join(WD, 'cwdTest');
785781

@@ -793,19 +789,15 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
793789
noDebug: true
794790
};
795791
const debugConfig = await initializeDebugConfig(config);
796-
await Promise.all([
797-
dc.launch(debugConfig),
798-
dc.waitForEvent('output').then((event) => {
799-
assert.strictEqual(event.body.output, 'Hello, World!\n');
800-
})
801-
]);
802-
});
803-
804-
test('should run program without cwd set (noDebug)', async function () {
805-
if (isDlvDap && dlvDapSkipsEnabled) {
806-
this.skip(); // OutputEvents not implemented
792+
dc.launch(debugConfig);
793+
let found = false;
794+
while (!found) {
795+
const event = await dc.waitForEvent('output');
796+
found = event.body.output === 'Hello, World!\n';
807797
}
798+
});
808799

800+
test('should run program without cwd set (noDebug)', async () => {
809801
const WD = path.join(DATA_ROOT, 'cwdTest');
810802
const PROGRAM = path.join(WD, 'cwdTest');
811803

@@ -818,19 +810,15 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
818810
noDebug: true
819811
};
820812
const debugConfig = await initializeDebugConfig(config);
821-
await Promise.all([
822-
dc.launch(debugConfig),
823-
dc.waitForEvent('output').then((event) => {
824-
assert.strictEqual(event.body.output, 'Goodbye, World.\n');
825-
})
826-
]);
827-
});
828-
829-
test('should run file program with cwd set (noDebug)', async function () {
830-
if (isDlvDap && dlvDapSkipsEnabled) {
831-
this.skip(); // OutputEvents not implemented
813+
dc.launch(debugConfig);
814+
let found = false;
815+
while (!found) {
816+
const event = await dc.waitForEvent('output');
817+
found = event.body.output === 'Goodbye, World.\n';
832818
}
819+
});
833820

821+
test('should run file program with cwd set (noDebug)', async () => {
834822
const WD = path.join(DATA_ROOT, 'cwdTest');
835823
const PROGRAM = path.join(WD, 'cwdTest', 'main.go');
836824

@@ -844,19 +832,15 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
844832
noDebug: true
845833
};
846834
const debugConfig = await initializeDebugConfig(config);
847-
await Promise.all([
848-
dc.launch(debugConfig),
849-
dc.waitForEvent('output').then((event) => {
850-
assert.strictEqual(event.body.output, 'Hello, World!\n');
851-
})
852-
]);
853-
});
854-
855-
test('should run file program without cwd set (noDebug)', async function () {
856-
if (isDlvDap && dlvDapSkipsEnabled) {
857-
this.skip(); // OutputEvents not implemented
835+
dc.launch(debugConfig);
836+
let found = false;
837+
while (!found) {
838+
const event = await dc.waitForEvent('output');
839+
found = event.body.output === 'Hello, World!\n';
858840
}
841+
});
859842

843+
test('should run file program without cwd set (noDebug)', async () => {
860844
const WD = path.join(DATA_ROOT, 'cwdTest');
861845
const PROGRAM = path.join(WD, 'cwdTest', 'main.go');
862846

@@ -869,12 +853,12 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
869853
noDebug: true
870854
};
871855
const debugConfig = await initializeDebugConfig(config);
872-
await Promise.all([
873-
dc.launch(debugConfig),
874-
dc.waitForEvent('output').then((event) => {
875-
assert.strictEqual(event.body.output, 'Goodbye, World.\n');
876-
})
877-
]);
856+
dc.launch(debugConfig);
857+
let found = false;
858+
while (!found) {
859+
const event = await dc.waitForEvent('output');
860+
found = event.body.output === 'Goodbye, World.\n';
861+
}
878862
});
879863
});
880864

0 commit comments

Comments
 (0)