1919using Xunit ;
2020namespace Microsoft . PowerShell . EditorServices . Test . Debugging
2121{
22+ [ Trait ( "Category" , "DebugService" ) ]
2223 public class DebugServiceTests : IDisposable
2324 {
2425 private readonly PsesInternalHost psesHost ;
@@ -81,13 +82,7 @@ private void OnDebuggerStopped(object sender, DebuggerStoppedEventArgs e)
8182
8283 private ScriptFile GetDebugScript ( string fileName )
8384 {
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 ) ) ) ;
9186 }
9287
9388 private VariableDetailsBase [ ] GetVariables ( string scopeName )
@@ -147,7 +142,6 @@ private Task<IReadOnlyList<LineBreakpoint>> GetConfirmedBreakpoints(ScriptFile s
147142 CancellationToken . None ) ;
148143 }
149144
150- [ Trait ( "Category" , "DebugService" ) ]
151145 [ Fact ]
152146 // This regression test asserts that `ExecuteScriptWithArgsAsync` works for both script
153147 // files and, in this case, in-line scripts (commands). The bug was that the cwd was
@@ -176,7 +170,6 @@ await debugService.SetCommandBreakpointsAsync(
176170 Assert . Equal ( "[ArrayList: 0]" , var . ValueString ) ;
177171 }
178172
179- [ Trait ( "Category" , "DebugService" ) ]
180173 [ Fact ]
181174 public async Task DebuggerAcceptsScriptArgs ( )
182175 {
@@ -238,7 +231,6 @@ public async Task DebuggerAcceptsScriptArgs()
238231 Assert . Equal ( "\" Extra1\" " , childVars [ 0 ] . ValueString ) ;
239232 }
240233
241- [ Trait ( "Category" , "DebugService" ) ]
242234 [ Fact ]
243235 public async Task DebuggerSetsAndClearsFunctionBreakpoints ( )
244236 {
@@ -264,7 +256,6 @@ public async Task DebuggerSetsAndClearsFunctionBreakpoints()
264256 Assert . Empty ( breakpoints ) ;
265257 }
266258
267- [ Trait ( "Category" , "DebugService" ) ]
268259 [ Fact ]
269260 public async Task DebuggerStopsOnFunctionBreakpoints ( )
270261 {
@@ -295,7 +286,6 @@ public async Task DebuggerStopsOnFunctionBreakpoints()
295286 Assert . Equal ( "2" , i . ValueString ) ;
296287 }
297288
298- [ Trait ( "Category" , "DebugService" ) ]
299289 [ Fact ]
300290 public async Task DebuggerSetsAndClearsLineBreakpoints ( )
301291 {
@@ -329,7 +319,6 @@ await debugService.SetLineBreakpointsAsync(
329319 Assert . Empty ( remainingBreakpoints ) ;
330320 }
331321
332- [ Trait ( "Category" , "DebugService" ) ]
333322 [ Fact ]
334323 public async Task DebuggerStopsOnLineBreakpoints ( )
335324 {
@@ -346,7 +335,6 @@ await debugService.SetLineBreakpointsAsync(
346335 AssertDebuggerStopped ( debugScriptFile . FilePath , 7 ) ;
347336 }
348337
349- [ Trait ( "Category" , "DebugService" ) ]
350338 [ Fact ]
351339 public async Task DebuggerStopsOnConditionalBreakpoints ( )
352340 {
@@ -384,7 +372,6 @@ await debugService.SetLineBreakpointsAsync(
384372 Assert . Equal ( $ "{ breakpointValue2 } ", i . ValueString ) ;
385373 }
386374
387- [ Trait ( "Category" , "DebugService" ) ]
388375 [ Fact ]
389376 public async Task DebuggerStopsOnHitConditionBreakpoint ( )
390377 {
@@ -408,7 +395,6 @@ await debugService.SetLineBreakpointsAsync(
408395 Assert . Equal ( $ "{ hitCount } ", i . ValueString ) ;
409396 }
410397
411- [ Trait ( "Category" , "DebugService" ) ]
412398 [ Fact ]
413399 public async Task DebuggerStopsOnConditionalAndHitConditionBreakpoint ( )
414400 {
@@ -431,7 +417,6 @@ await debugService.SetLineBreakpointsAsync(
431417 Assert . Equal ( "10" , i . ValueString ) ;
432418 }
433419
434- [ Trait ( "Category" , "DebugService" ) ]
435420 [ Fact ]
436421 public async Task DebuggerProvidesMessageForInvalidConditionalBreakpoint ( )
437422 {
@@ -460,7 +445,6 @@ await debugService.SetLineBreakpointsAsync(
460445 Assert . Contains ( "Unexpected token '-ez'" , breakpoints [ 0 ] . Message ) ;
461446 }
462447
463- [ Trait ( "Category" , "DebugService" ) ]
464448 [ Fact ]
465449 public async Task DebuggerFindsParseableButInvalidSimpleBreakpointConditions ( )
466450 {
@@ -483,7 +467,6 @@ await debugService.SetLineBreakpointsAsync(
483467 Assert . Contains ( "Use '-gt' instead of '>'" , breakpoints [ 1 ] . Message ) ;
484468 }
485469
486- [ Trait ( "Category" , "DebugService" ) ]
487470 [ Fact ]
488471 public async Task DebuggerBreaksWhenRequested ( )
489472 {
@@ -495,7 +478,6 @@ public async Task DebuggerBreaksWhenRequested()
495478 AssertDebuggerPaused ( ) ;
496479 }
497480
498- [ Trait ( "Category" , "DebugService" ) ]
499481 [ Fact ]
500482 public async Task DebuggerRunsCommandsWhileStopped ( )
501483 {
@@ -510,7 +492,6 @@ public async Task DebuggerRunsCommandsWhileStopped()
510492 Assert . Equal ( 17 , ( await executeTask . ConfigureAwait ( true ) ) [ 0 ] ) ;
511493 }
512494
513- [ Trait ( "Category" , "DebugService" ) ]
514495 [ Fact ]
515496 public async Task DebuggerVariableStringDisplaysCorrectly ( )
516497 {
@@ -529,7 +510,6 @@ await debugService.SetLineBreakpointsAsync(
529510 Assert . False ( var . IsExpandable ) ;
530511 }
531512
532- [ Trait ( "Category" , "DebugService" ) ]
533513 [ Fact ]
534514 public async Task DebuggerGetsVariables ( )
535515 {
@@ -579,7 +559,6 @@ await debugService.SetLineBreakpointsAsync(
579559 Assert . Equal ( "$false" , falseVar . ValueString ) ;
580560 }
581561
582- [ Trait ( "Category" , "DebugService" ) ]
583562 [ Fact ]
584563 public async Task DebuggerSetsVariablesNoConversion ( )
585564 {
@@ -634,7 +613,6 @@ await debugService.SetLineBreakpointsAsync(
634613 Assert . Equal ( newGlobalIntValue , intGlobalVar . ValueString ) ;
635614 }
636615
637- [ Trait ( "Category" , "DebugService" ) ]
638616 [ Fact ( Skip = "Variable conversion is broken" ) ]
639617 public async Task DebuggerSetsVariablesWithConversion ( )
640618 {
@@ -693,7 +671,6 @@ await debugService.SetLineBreakpointsAsync(
693671 Assert . Equal ( newGlobalValue , globalVar . ValueString ) ;
694672 }
695673
696- [ Trait ( "Category" , "DebugService" ) ]
697674 [ Fact ]
698675 public async Task DebuggerVariableEnumDisplaysCorrectly ( )
699676 {
@@ -714,7 +691,6 @@ await debugService.SetLineBreakpointsAsync(
714691 Assert . False ( var . IsExpandable ) ;
715692 }
716693
717- [ Trait ( "Category" , "DebugService" ) ]
718694 [ Fact ]
719695 public async Task DebuggerVariableHashtableDisplaysCorrectly ( )
720696 {
@@ -751,7 +727,6 @@ await debugService.SetLineBreakpointsAsync(
751727 }
752728 }
753729
754- [ Trait ( "Category" , "DebugService" ) ]
755730 [ Fact ]
756731 public async Task DebuggerVariableNullStringDisplaysCorrectly ( )
757732 {
@@ -772,7 +747,6 @@ await debugService.SetLineBreakpointsAsync(
772747 Assert . True ( nullStringVar . IsExpandable ) ;
773748 }
774749
775- [ Trait ( "Category" , "DebugService" ) ]
776750 [ Fact ]
777751 public async Task DebuggerVariablePSObjectDisplaysCorrectly ( )
778752 {
@@ -800,7 +774,6 @@ await debugService.SetLineBreakpointsAsync(
800774 Assert . Equal ( "\" John\" " , childVars [ "Name" ] ) ;
801775 }
802776
803- [ Trait ( "Category" , "DebugService" ) ]
804777 [ Fact ]
805778 public async Task DebuggerVariablePSCustomObjectDisplaysCorrectly ( )
806779 {
@@ -830,7 +803,6 @@ await debugService.SetLineBreakpointsAsync(
830803
831804 // Verifies fix for issue #86, $proc = Get-Process foo displays just the ETS property set
832805 // and not all process properties.
833- [ Trait ( "Category" , "DebugService" ) ]
834806 [ Fact ( Skip = "Length of child vars is wrong now" ) ]
835807 public async Task DebuggerVariableProcessObjDisplaysCorrectly ( )
836808 {
0 commit comments