@@ -25,87 +25,84 @@ import { continueSession, waitForDebugAdapterRequest } from "../../utilities/deb
25
25
import { activateExtensionForSuite , folderInRootWorkspace } from "../utilities/testutilities" ;
26
26
import { Version } from "../../../src/utilities/version" ;
27
27
28
- for ( let i = 0 ; i < 25 ; ++ i ) {
29
- suite . only ( "Build Commands @slow " + i , function ( ) {
30
- // Default timeout is a bit too short, give it a little bit more time
31
- this . timeout ( 3 * 60 * 1000 ) ;
28
+ suite ( "Build Commands @slow" , function ( ) {
29
+ // Default timeout is a bit too short, give it a little bit more time
30
+ this . timeout ( 3 * 60 * 1000 ) ;
32
31
33
- let folderContext : FolderContext ;
34
- let workspaceContext : WorkspaceContext ;
35
- const uri = testAssetUri ( "defaultPackage/Sources/PackageExe/main.swift" ) ;
36
- const breakpoints = [
37
- new vscode . SourceBreakpoint ( new vscode . Location ( uri , new vscode . Position ( 2 , 0 ) ) ) ,
38
- ] ;
32
+ let folderContext : FolderContext ;
33
+ let workspaceContext : WorkspaceContext ;
34
+ const uri = testAssetUri ( "defaultPackage/Sources/PackageExe/main.swift" ) ;
35
+ const breakpoints = [
36
+ new vscode . SourceBreakpoint ( new vscode . Location ( uri , new vscode . Position ( 2 , 0 ) ) ) ,
37
+ ] ;
39
38
40
- activateExtensionForSuite ( {
41
- async setup ( ctx ) {
42
- // The description of this package is crashing on Windows with Swift 5.9.x and below
43
- if (
44
- process . platform === "win32" &&
45
- ctx . globalToolchain . swiftVersion . isLessThan ( new Version ( 5 , 10 , 0 ) )
46
- ) {
47
- this . skip ( ) ;
48
- }
49
- // A breakpoint will have not effect on the Run command.
50
- vscode . debug . addBreakpoints ( breakpoints ) ;
39
+ activateExtensionForSuite ( {
40
+ async setup ( ctx ) {
41
+ // The description of this package is crashing on Windows with Swift 5.9.x and below
42
+ if (
43
+ process . platform === "win32" &&
44
+ ctx . globalToolchain . swiftVersion . isLessThan ( new Version ( 5 , 10 , 0 ) )
45
+ ) {
46
+ this . skip ( ) ;
47
+ }
48
+ // A breakpoint will have not effect on the Run command.
49
+ vscode . debug . addBreakpoints ( breakpoints ) ;
51
50
52
- workspaceContext = ctx ;
53
- await waitForNoRunningTasks ( ) ;
54
- folderContext = await folderInRootWorkspace ( "defaultPackage" , workspaceContext ) ;
55
- await workspaceContext . focusFolder ( folderContext ) ;
56
- } ,
57
- requiresDebugger : true ,
58
- requiresLSP : true ,
59
- } ) ;
51
+ workspaceContext = ctx ;
52
+ await waitForNoRunningTasks ( ) ;
53
+ folderContext = await folderInRootWorkspace ( "defaultPackage" , workspaceContext ) ;
54
+ await workspaceContext . focusFolder ( folderContext ) ;
55
+ } ,
56
+ requiresDebugger : true ,
57
+ } ) ;
60
58
61
- suiteTeardown ( async ( ) => {
62
- vscode . debug . removeBreakpoints ( breakpoints ) ;
63
- } ) ;
59
+ suiteTeardown ( async ( ) => {
60
+ vscode . debug . removeBreakpoints ( breakpoints ) ;
61
+ } ) ;
64
62
65
- test ( "Swift: Run Build" , async ( ) => {
66
- const result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
67
- expect ( result ) . to . be . true ;
68
- } ) ;
63
+ test ( "Swift: Run Build" , async ( ) => {
64
+ const result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
65
+ expect ( result ) . to . be . true ;
66
+ } ) ;
69
67
70
- test ( "Swift: Debug Build" , async ( ) => {
71
- // Promise used to indicate we hit the break point.
72
- // NB: "stopped" is the exact command when debuggee has stopped due to break point,
73
- // but "stackTrace" is the deterministic sync point we will use to make sure we can execute continue
74
- const bpPromise = waitForDebugAdapterRequest (
75
- "Debug PackageExe (defaultPackage)" ,
76
- workspaceContext . globalToolchain . swiftVersion ,
77
- "stackTrace"
78
- ) ;
68
+ test ( "Swift: Debug Build" , async ( ) => {
69
+ // Promise used to indicate we hit the break point.
70
+ // NB: "stopped" is the exact command when debuggee has stopped due to break point,
71
+ // but "stackTrace" is the deterministic sync point we will use to make sure we can execute continue
72
+ const bpPromise = waitForDebugAdapterRequest (
73
+ "Debug PackageExe (defaultPackage)" ,
74
+ workspaceContext . globalToolchain . swiftVersion ,
75
+ "stackTrace"
76
+ ) ;
79
77
80
- const resultPromise : Thenable < boolean > = vscode . commands . executeCommand (
81
- Commands . DEBUG ,
82
- "PackageExe"
83
- ) ;
78
+ const resultPromise : Thenable < boolean > = vscode . commands . executeCommand (
79
+ Commands . DEBUG ,
80
+ "PackageExe"
81
+ ) ;
84
82
85
- await bpPromise ;
86
- let succeeded = false ;
87
- void resultPromise . then ( s => ( succeeded = s ) ) ;
88
- while ( ! succeeded ) {
89
- await continueSession ( ) ;
90
- await new Promise ( r => setTimeout ( r , 500 ) ) ;
91
- }
92
- await expect ( resultPromise ) . to . eventually . be . true ;
93
- } ) ;
83
+ await bpPromise ;
84
+ let succeeded = false ;
85
+ void resultPromise . then ( s => ( succeeded = s ) ) ;
86
+ while ( ! succeeded ) {
87
+ await continueSession ( ) ;
88
+ await new Promise ( r => setTimeout ( r , 500 ) ) ;
89
+ }
90
+ await expect ( resultPromise ) . to . eventually . be . true ;
91
+ } ) ;
94
92
95
- test ( "Swift: Clean Build" , async ( ) => {
96
- let result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
97
- expect ( result ) . to . be . true ;
93
+ test ( "Swift: Clean Build" , async ( ) => {
94
+ let result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
95
+ expect ( result ) . to . be . true ;
98
96
99
- const buildPath = path . join ( folderContext . folder . fsPath , ".build" ) ;
100
- const beforeItemCount = ( await fs . readdir ( buildPath ) ) . length ;
97
+ const buildPath = path . join ( folderContext . folder . fsPath , ".build" ) ;
98
+ const beforeItemCount = ( await fs . readdir ( buildPath ) ) . length ;
101
99
102
- result = await vscode . commands . executeCommand ( Commands . CLEAN_BUILD ) ;
103
- expect ( result ) . to . be . true ;
100
+ result = await vscode . commands . executeCommand ( Commands . CLEAN_BUILD ) ;
101
+ expect ( result ) . to . be . true ;
104
102
105
- const afterItemCount = ( await fs . readdir ( buildPath ) ) . length ;
106
- // .build folder is going to be filled with built artifacts after Commands.RUN command
107
- // After executing the clean command the build directory is guranteed to have less entry.
108
- expect ( afterItemCount ) . to . be . lessThan ( beforeItemCount ) ;
109
- } ) ;
103
+ const afterItemCount = ( await fs . readdir ( buildPath ) ) . length ;
104
+ // .build folder is going to be filled with built artifacts after Commands.RUN command
105
+ // After executing the clean command the build directory is guranteed to have less entry.
106
+ expect ( afterItemCount ) . to . be . lessThan ( beforeItemCount ) ;
110
107
} ) ;
111
- }
108
+ } ) ;
0 commit comments