@@ -439,7 +439,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
439
439
// an initialized event.
440
440
await Promise . all ( [
441
441
new Promise < void > ( async ( resolve ) => {
442
- console . log ( `Setting up attach request for ${ JSON . stringify ( debugConfig ) } .` ) ;
442
+ const debugConfigCopy = Object . assign ( { } , debugConfig ) ;
443
+ delete debugConfigCopy . env ;
444
+ console . log ( `Setting up attach request for ${ JSON . stringify ( debugConfigCopy ) } .` ) ;
443
445
const attachResult = await dc . attachRequest ( debugConfig as DebugProtocol . AttachRequestArguments ) ;
444
446
assert . ok ( attachResult . success ) ;
445
447
resolve ( ) ;
@@ -556,6 +558,10 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
556
558
} ) ;
557
559
558
560
suite ( 'env' , ( ) => {
561
+ if ( ! isDlvDap ) {
562
+ return ;
563
+ }
564
+
559
565
let sandbox : sinon . SinonSandbox ;
560
566
561
567
setup ( ( ) => {
@@ -620,6 +626,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
620
626
} ) ;
621
627
622
628
suite ( 'launch' , ( ) => {
629
+ if ( ! isDlvDap ) {
630
+ return ;
631
+ }
623
632
test ( 'should run program to the end' , async ( ) => {
624
633
const PROGRAM = path . join ( DATA_ROOT , 'baseTest' ) ;
625
634
@@ -828,6 +837,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
828
837
} ) ;
829
838
830
839
suite ( 'set current working directory' , ( ) => {
840
+ if ( ! isDlvDap ) {
841
+ return ;
842
+ }
831
843
test ( 'should debug program with cwd set' , async ( ) => {
832
844
const WD = path . join ( DATA_ROOT , 'cwdTest' ) ;
833
845
const PROGRAM = path . join ( WD , 'cwdTest' ) ;
@@ -994,6 +1006,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
994
1006
} ) ;
995
1007
996
1008
suite ( 'remote attach' , ( ) => {
1009
+ if ( withConsole ) {
1010
+ return ;
1011
+ }
997
1012
let childProcess : cp . ChildProcess ;
998
1013
let server : number ;
999
1014
let debugConfig : DebugConfiguration ;
@@ -1094,6 +1109,11 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
1094
1109
await dc . hitBreakpoint ( debugConfig , getBreakpointLocation ( FILE , BREAKPOINT_LINE ) ) ;
1095
1110
} ) ;
1096
1111
1112
+ // stop here for integrated terminal test mode.
1113
+ if ( withConsole ) {
1114
+ return ;
1115
+ }
1116
+
1097
1117
test ( 'stopped for a breakpoint set during initialization (remote attach)' , async ( ) => {
1098
1118
const FILE = path . join ( DATA_ROOT , 'helloWorldServer' , 'main.go' ) ;
1099
1119
const BREAKPOINT_LINE = 29 ;
@@ -1298,6 +1318,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
1298
1318
} ) ;
1299
1319
1300
1320
suite ( 'conditionalBreakpoints' , ( ) => {
1321
+ if ( withConsole ) {
1322
+ return ;
1323
+ }
1301
1324
test ( 'should stop on conditional breakpoint' , async ( ) => {
1302
1325
const PROGRAM = path . join ( DATA_ROOT , 'condbp' ) ;
1303
1326
const FILE = path . join ( DATA_ROOT , 'condbp' , 'condbp.go' ) ;
@@ -1432,6 +1455,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
1432
1455
} ) ;
1433
1456
1434
1457
suite ( 'panicBreakpoints' , ( ) => {
1458
+ if ( withConsole ) {
1459
+ return ;
1460
+ }
1435
1461
test ( 'should stop on panic' , async ( ) => {
1436
1462
const PROGRAM_WITH_EXCEPTION = path . join ( DATA_ROOT , 'panic' ) ;
1437
1463
@@ -1519,6 +1545,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
1519
1545
} ) ;
1520
1546
1521
1547
suite ( 'disconnect' , ( ) => {
1548
+ if ( withConsole ) {
1549
+ return ;
1550
+ }
1522
1551
// The teardown code for the Go Debug Adapter test suite issues a disconnectRequest.
1523
1552
// In order for these tests to pass, the debug adapter must not fail if a
1524
1553
// disconnectRequest is sent after it has already disconnected.
@@ -1775,6 +1804,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
1775
1804
} ) ;
1776
1805
1777
1806
suite ( 'switch goroutine' , ( ) => {
1807
+ if ( withConsole ) {
1808
+ return ;
1809
+ }
1778
1810
async function continueAndFindParkedGoroutine ( file : string ) : Promise < number > {
1779
1811
// Find a goroutine that is stopped in parked.
1780
1812
const bp = getBreakpointLocation ( file , 8 ) ;
@@ -1915,6 +1947,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
1915
1947
} ) ;
1916
1948
1917
1949
suite ( 'logDest attribute tests' , ( ) => {
1950
+ if ( ! isDlvDap ) {
1951
+ return ;
1952
+ }
1918
1953
const PROGRAM = path . join ( DATA_ROOT , 'baseTest' ) ;
1919
1954
1920
1955
let tmpDir : string ;
@@ -1986,7 +2021,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
1986
2021
} ) ;
1987
2022
1988
2023
suite ( 'substitute path' , ( ) => {
1989
- if ( affectedByIssue832 ( ) ) {
2024
+ if ( withConsole || affectedByIssue832 ( ) ) {
1990
2025
return ;
1991
2026
}
1992
2027
// TODO(suzmue): add unit tests for substitutePath.
0 commit comments