@@ -25,87 +25,85 @@ 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 . only ( "Build Commands @slow " + i , 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
+ requiresLSP : true ,
58
+ } ) ;
60
59
61
- suiteTeardown ( async ( ) => {
62
- vscode . debug . removeBreakpoints ( breakpoints ) ;
63
- } ) ;
60
+ suiteTeardown ( async ( ) => {
61
+ vscode . debug . removeBreakpoints ( breakpoints ) ;
62
+ } ) ;
64
63
65
- test ( "Swift: Run Build" , async ( ) => {
66
- const result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
67
- expect ( result ) . to . be . true ;
68
- } ) ;
64
+ test ( "Swift: Run Build" , async ( ) => {
65
+ const result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
66
+ expect ( result ) . to . be . true ;
67
+ } ) ;
69
68
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
- ) ;
69
+ test ( "Swift: Debug Build" , async ( ) => {
70
+ // Promise used to indicate we hit the break point.
71
+ // NB: "stopped" is the exact command when debuggee has stopped due to break point,
72
+ // but "stackTrace" is the deterministic sync point we will use to make sure we can execute continue
73
+ const bpPromise = waitForDebugAdapterRequest (
74
+ "Debug PackageExe (defaultPackage)" ,
75
+ workspaceContext . globalToolchain . swiftVersion ,
76
+ "stackTrace"
77
+ ) ;
79
78
80
- const resultPromise : Thenable < boolean > = vscode . commands . executeCommand (
81
- Commands . DEBUG ,
82
- "PackageExe"
83
- ) ;
79
+ const resultPromise : Thenable < boolean > = vscode . commands . executeCommand (
80
+ Commands . DEBUG ,
81
+ "PackageExe"
82
+ ) ;
84
83
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
- } ) ;
84
+ await bpPromise ;
85
+ let succeeded = false ;
86
+ void resultPromise . then ( s => ( succeeded = s ) ) ;
87
+ while ( ! succeeded ) {
88
+ await continueSession ( ) ;
89
+ await new Promise ( r => setTimeout ( r , 500 ) ) ;
90
+ }
91
+ await expect ( resultPromise ) . to . eventually . be . true ;
92
+ } ) ;
94
93
95
- test ( "Swift: Clean Build" , async ( ) => {
96
- let result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
97
- expect ( result ) . to . be . true ;
94
+ test ( "Swift: Clean Build" , async ( ) => {
95
+ let result = await vscode . commands . executeCommand ( Commands . RUN , "PackageExe" ) ;
96
+ expect ( result ) . to . be . true ;
98
97
99
- const buildPath = path . join ( folderContext . folder . fsPath , ".build" ) ;
100
- const beforeItemCount = ( await fs . readdir ( buildPath ) ) . length ;
98
+ const buildPath = path . join ( folderContext . folder . fsPath , ".build" ) ;
99
+ const beforeItemCount = ( await fs . readdir ( buildPath ) ) . length ;
101
100
102
- result = await vscode . commands . executeCommand ( Commands . CLEAN_BUILD ) ;
103
- expect ( result ) . to . be . true ;
101
+ result = await vscode . commands . executeCommand ( Commands . CLEAN_BUILD ) ;
102
+ expect ( result ) . to . be . true ;
104
103
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
- } ) ;
104
+ const afterItemCount = ( await fs . readdir ( buildPath ) ) . length ;
105
+ // .build folder is going to be filled with built artifacts after Commands.RUN command
106
+ // After executing the clean command the build directory is guranteed to have less entry.
107
+ expect ( afterItemCount ) . to . be . lessThan ( beforeItemCount ) ;
110
108
} ) ;
111
- }
109
+ } ) ;
0 commit comments