19
19
using Xunit ;
20
20
namespace Microsoft . PowerShell . EditorServices . Test . Debugging
21
21
{
22
+ [ Trait ( "Category" , "DebugService" ) ]
22
23
public class DebugServiceTests : IDisposable
23
24
{
24
25
private readonly PsesInternalHost psesHost ;
@@ -81,13 +82,7 @@ private void OnDebuggerStopped(object sender, DebuggerStoppedEventArgs e)
81
82
82
83
private ScriptFile GetDebugScript ( string fileName )
83
84
{
84
- return workspace . GetFile (
85
- TestUtilities . NormalizePath ( Path . Combine (
86
- Path . GetDirectoryName ( typeof ( DebugServiceTests ) . Assembly . Location ) ,
87
- // TODO: When testing net461 with x64 host, another .. is needed!
88
- "../../../../PowerShellEditorServices.Test.Shared/Debugging" ,
89
- fileName
90
- ) ) ) ;
85
+ return workspace . GetFile ( TestUtilities . GetSharedPath ( Path . Combine ( "Debugging" , fileName ) ) ) ;
91
86
}
92
87
93
88
private VariableDetailsBase [ ] GetVariables ( string scopeName )
@@ -147,7 +142,6 @@ private Task<IReadOnlyList<LineBreakpoint>> GetConfirmedBreakpoints(ScriptFile s
147
142
CancellationToken . None ) ;
148
143
}
149
144
150
- [ Trait ( "Category" , "DebugService" ) ]
151
145
[ Fact ]
152
146
// This regression test asserts that `ExecuteScriptWithArgsAsync` works for both script
153
147
// files and, in this case, in-line scripts (commands). The bug was that the cwd was
@@ -176,7 +170,6 @@ await debugService.SetCommandBreakpointsAsync(
176
170
Assert . Equal ( "[ArrayList: 0]" , var . ValueString ) ;
177
171
}
178
172
179
- [ Trait ( "Category" , "DebugService" ) ]
180
173
[ Fact ]
181
174
public async Task DebuggerAcceptsScriptArgs ( )
182
175
{
@@ -238,7 +231,6 @@ public async Task DebuggerAcceptsScriptArgs()
238
231
Assert . Equal ( "\" Extra1\" " , childVars [ 0 ] . ValueString ) ;
239
232
}
240
233
241
- [ Trait ( "Category" , "DebugService" ) ]
242
234
[ Fact ]
243
235
public async Task DebuggerSetsAndClearsFunctionBreakpoints ( )
244
236
{
@@ -264,7 +256,6 @@ public async Task DebuggerSetsAndClearsFunctionBreakpoints()
264
256
Assert . Empty ( breakpoints ) ;
265
257
}
266
258
267
- [ Trait ( "Category" , "DebugService" ) ]
268
259
[ Fact ]
269
260
public async Task DebuggerStopsOnFunctionBreakpoints ( )
270
261
{
@@ -295,7 +286,6 @@ public async Task DebuggerStopsOnFunctionBreakpoints()
295
286
Assert . Equal ( "2" , i . ValueString ) ;
296
287
}
297
288
298
- [ Trait ( "Category" , "DebugService" ) ]
299
289
[ Fact ]
300
290
public async Task DebuggerSetsAndClearsLineBreakpoints ( )
301
291
{
@@ -329,7 +319,6 @@ await debugService.SetLineBreakpointsAsync(
329
319
Assert . Empty ( remainingBreakpoints ) ;
330
320
}
331
321
332
- [ Trait ( "Category" , "DebugService" ) ]
333
322
[ Fact ]
334
323
public async Task DebuggerStopsOnLineBreakpoints ( )
335
324
{
@@ -346,7 +335,6 @@ await debugService.SetLineBreakpointsAsync(
346
335
AssertDebuggerStopped ( debugScriptFile . FilePath , 7 ) ;
347
336
}
348
337
349
- [ Trait ( "Category" , "DebugService" ) ]
350
338
[ Fact ]
351
339
public async Task DebuggerStopsOnConditionalBreakpoints ( )
352
340
{
@@ -384,7 +372,6 @@ await debugService.SetLineBreakpointsAsync(
384
372
Assert . Equal ( $ "{ breakpointValue2 } ", i . ValueString ) ;
385
373
}
386
374
387
- [ Trait ( "Category" , "DebugService" ) ]
388
375
[ Fact ]
389
376
public async Task DebuggerStopsOnHitConditionBreakpoint ( )
390
377
{
@@ -408,7 +395,6 @@ await debugService.SetLineBreakpointsAsync(
408
395
Assert . Equal ( $ "{ hitCount } ", i . ValueString ) ;
409
396
}
410
397
411
- [ Trait ( "Category" , "DebugService" ) ]
412
398
[ Fact ]
413
399
public async Task DebuggerStopsOnConditionalAndHitConditionBreakpoint ( )
414
400
{
@@ -431,7 +417,6 @@ await debugService.SetLineBreakpointsAsync(
431
417
Assert . Equal ( "10" , i . ValueString ) ;
432
418
}
433
419
434
- [ Trait ( "Category" , "DebugService" ) ]
435
420
[ Fact ]
436
421
public async Task DebuggerProvidesMessageForInvalidConditionalBreakpoint ( )
437
422
{
@@ -460,7 +445,6 @@ await debugService.SetLineBreakpointsAsync(
460
445
Assert . Contains ( "Unexpected token '-ez'" , breakpoints [ 0 ] . Message ) ;
461
446
}
462
447
463
- [ Trait ( "Category" , "DebugService" ) ]
464
448
[ Fact ]
465
449
public async Task DebuggerFindsParseableButInvalidSimpleBreakpointConditions ( )
466
450
{
@@ -483,7 +467,6 @@ await debugService.SetLineBreakpointsAsync(
483
467
Assert . Contains ( "Use '-gt' instead of '>'" , breakpoints [ 1 ] . Message ) ;
484
468
}
485
469
486
- [ Trait ( "Category" , "DebugService" ) ]
487
470
[ Fact ]
488
471
public async Task DebuggerBreaksWhenRequested ( )
489
472
{
@@ -495,7 +478,6 @@ public async Task DebuggerBreaksWhenRequested()
495
478
AssertDebuggerPaused ( ) ;
496
479
}
497
480
498
- [ Trait ( "Category" , "DebugService" ) ]
499
481
[ Fact ]
500
482
public async Task DebuggerRunsCommandsWhileStopped ( )
501
483
{
@@ -510,7 +492,6 @@ public async Task DebuggerRunsCommandsWhileStopped()
510
492
Assert . Equal ( 17 , ( await executeTask . ConfigureAwait ( true ) ) [ 0 ] ) ;
511
493
}
512
494
513
- [ Trait ( "Category" , "DebugService" ) ]
514
495
[ Fact ]
515
496
public async Task DebuggerVariableStringDisplaysCorrectly ( )
516
497
{
@@ -529,7 +510,6 @@ await debugService.SetLineBreakpointsAsync(
529
510
Assert . False ( var . IsExpandable ) ;
530
511
}
531
512
532
- [ Trait ( "Category" , "DebugService" ) ]
533
513
[ Fact ]
534
514
public async Task DebuggerGetsVariables ( )
535
515
{
@@ -579,7 +559,6 @@ await debugService.SetLineBreakpointsAsync(
579
559
Assert . Equal ( "$false" , falseVar . ValueString ) ;
580
560
}
581
561
582
- [ Trait ( "Category" , "DebugService" ) ]
583
562
[ Fact ]
584
563
public async Task DebuggerSetsVariablesNoConversion ( )
585
564
{
@@ -634,7 +613,6 @@ await debugService.SetLineBreakpointsAsync(
634
613
Assert . Equal ( newGlobalIntValue , intGlobalVar . ValueString ) ;
635
614
}
636
615
637
- [ Trait ( "Category" , "DebugService" ) ]
638
616
[ Fact ( Skip = "Variable conversion is broken" ) ]
639
617
public async Task DebuggerSetsVariablesWithConversion ( )
640
618
{
@@ -693,7 +671,6 @@ await debugService.SetLineBreakpointsAsync(
693
671
Assert . Equal ( newGlobalValue , globalVar . ValueString ) ;
694
672
}
695
673
696
- [ Trait ( "Category" , "DebugService" ) ]
697
674
[ Fact ]
698
675
public async Task DebuggerVariableEnumDisplaysCorrectly ( )
699
676
{
@@ -714,7 +691,6 @@ await debugService.SetLineBreakpointsAsync(
714
691
Assert . False ( var . IsExpandable ) ;
715
692
}
716
693
717
- [ Trait ( "Category" , "DebugService" ) ]
718
694
[ Fact ]
719
695
public async Task DebuggerVariableHashtableDisplaysCorrectly ( )
720
696
{
@@ -751,7 +727,6 @@ await debugService.SetLineBreakpointsAsync(
751
727
}
752
728
}
753
729
754
- [ Trait ( "Category" , "DebugService" ) ]
755
730
[ Fact ]
756
731
public async Task DebuggerVariableNullStringDisplaysCorrectly ( )
757
732
{
@@ -772,7 +747,6 @@ await debugService.SetLineBreakpointsAsync(
772
747
Assert . True ( nullStringVar . IsExpandable ) ;
773
748
}
774
749
775
- [ Trait ( "Category" , "DebugService" ) ]
776
750
[ Fact ]
777
751
public async Task DebuggerVariablePSObjectDisplaysCorrectly ( )
778
752
{
@@ -800,7 +774,6 @@ await debugService.SetLineBreakpointsAsync(
800
774
Assert . Equal ( "\" John\" " , childVars [ "Name" ] ) ;
801
775
}
802
776
803
- [ Trait ( "Category" , "DebugService" ) ]
804
777
[ Fact ]
805
778
public async Task DebuggerVariablePSCustomObjectDisplaysCorrectly ( )
806
779
{
@@ -830,7 +803,6 @@ await debugService.SetLineBreakpointsAsync(
830
803
831
804
// Verifies fix for issue #86, $proc = Get-Process foo displays just the ETS property set
832
805
// and not all process properties.
833
- [ Trait ( "Category" , "DebugService" ) ]
834
806
[ Fact ( Skip = "Length of child vars is wrong now" ) ]
835
807
public async Task DebuggerVariableProcessObjDisplaysCorrectly ( )
836
808
{
0 commit comments