@@ -10,7 +10,6 @@ func TestTestCommandModel_cmdSlice(t *testing.T) {
1010 tests := []struct {
1111 name string
1212 projectPath string
13- isWorkspace bool
1413 scheme string
1514 destination string
1615 generateCodeCoverage bool
@@ -22,141 +21,135 @@ func TestTestCommandModel_cmdSlice(t *testing.T) {
2221 {
2322 name : "simulator" ,
2423 projectPath : "" ,
25- isWorkspace : false ,
2624 scheme : "" ,
2725 destination : "id 2323asd2s" ,
2826 generateCodeCoverage : false ,
2927 disableIndexWhileBuilding : false ,
30- customBuildActions : [] string { "" } ,
31- customOptions : [] string { "" } ,
28+ customBuildActions : nil ,
29+ customOptions : nil ,
3230 want : []string {
3331 "xcodebuild" ,
34- "" ,
3532 "test" ,
3633 "-destination" ,
3734 "id 2323asd2s" ,
38- "" ,
3935 },
4036 },
4137 {
4238 name : "generic iOS" ,
4339 projectPath : "" ,
44- isWorkspace : false ,
4540 scheme : "" ,
4641 destination : "generic/platform=iOS" ,
4742 generateCodeCoverage : false ,
4843 disableIndexWhileBuilding : false ,
49- customBuildActions : [] string { "" } ,
50- customOptions : [] string { "" } ,
44+ customBuildActions : nil ,
45+ customOptions : nil ,
5146 want : []string {
5247 "xcodebuild" ,
53- "" ,
5448 "test" ,
5549 "-destination" ,
5650 "generic/platform=iOS" ,
57- "" ,
5851 },
5952 },
6053 {
6154 name : "scheme" ,
6255 projectPath : "" ,
63- isWorkspace : false ,
6456 scheme : "ios_scheme" ,
6557 destination : "" ,
6658 generateCodeCoverage : false ,
6759 disableIndexWhileBuilding : false ,
68- customBuildActions : [] string { "" } ,
69- customOptions : [] string { "" } ,
60+ customBuildActions : nil ,
61+ customOptions : nil ,
7062 want : []string {
7163 "xcodebuild" ,
7264 "-scheme" ,
7365 "ios_scheme" ,
74- "" ,
7566 "test" ,
76- "" ,
7767 },
7868 },
7969 {
8070 name : "generate code coverage" ,
8171 projectPath : "" ,
82- isWorkspace : false ,
8372 scheme : "" ,
8473 destination : "" ,
8574 generateCodeCoverage : true ,
8675 disableIndexWhileBuilding : false ,
87- customBuildActions : [] string { "" } ,
88- customOptions : [] string { "" } ,
76+ customBuildActions : nil ,
77+ customOptions : nil ,
8978 want : []string {
9079 "xcodebuild" ,
9180 "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES" ,
9281 "GCC_GENERATE_TEST_COVERAGE_FILES=YES" ,
93- "" ,
9482 "test" ,
95- "" ,
9683 },
9784 },
9885 {
9986 name : "workspace" ,
10087 projectPath : "ios/project.xcworkspace" ,
101- isWorkspace : true ,
10288 scheme : "" ,
10389 destination : "" ,
10490 generateCodeCoverage : false ,
10591 disableIndexWhileBuilding : false ,
106- customBuildActions : [] string { "" } ,
107- customOptions : [] string { "" } ,
92+ customBuildActions : nil ,
93+ customOptions : nil ,
10894 want : []string {
10995 "xcodebuild" ,
11096 "-workspace" ,
11197 "ios/project.xcworkspace" ,
112- "" ,
11398 "test" ,
114- "" ,
11599 },
116100 },
117101 {
118102 name : "project" ,
119103 projectPath : "ios/project.xcodeproj" ,
120- isWorkspace : false ,
121104 scheme : "" ,
122105 destination : "" ,
123106 generateCodeCoverage : false ,
124107 disableIndexWhileBuilding : false ,
125- customBuildActions : [] string { "" } ,
126- customOptions : [] string { "" } ,
108+ customBuildActions : nil ,
109+ customOptions : nil ,
127110 want : []string {
128111 "xcodebuild" ,
129112 "-project" ,
130113 "ios/project.xcodeproj" ,
131- "" ,
132114 "test" ,
133- "" ,
134115 },
135116 },
136117 {
137118 name : "disable index while building" ,
138119 projectPath : "" ,
139- isWorkspace : false ,
140120 scheme : "" ,
141121 destination : "" ,
142122 generateCodeCoverage : false ,
143123 disableIndexWhileBuilding : true ,
144- customBuildActions : [] string { "" } ,
145- customOptions : [] string { "" } ,
124+ customBuildActions : nil ,
125+ customOptions : nil ,
146126 want : []string {
147127 "xcodebuild" ,
148- "" ,
149128 "test" ,
150129 "COMPILER_INDEX_STORE_ENABLE=NO" ,
151- "" ,
130+ },
131+ },
132+ {
133+ name : "SPM project" ,
134+ projectPath : "Package.swift" ,
135+ scheme : "CoolLibrary" ,
136+ destination : "" ,
137+ generateCodeCoverage : false ,
138+ disableIndexWhileBuilding : false ,
139+ customBuildActions : nil ,
140+ customOptions : nil ,
141+ want : []string {
142+ "xcodebuild" ,
143+ "-scheme" ,
144+ "CoolLibrary" ,
145+ "test" ,
152146 },
153147 },
154148 }
155149 for _ , tt := range tests {
156150 t .Run (tt .name , func (t * testing.T ) {
157151 c := & TestCommandModel {
158152 projectPath : tt .projectPath ,
159- isWorkspace : tt .isWorkspace ,
160153 scheme : tt .scheme ,
161154 destination : tt .destination ,
162155 generateCodeCoverage : tt .generateCodeCoverage ,
0 commit comments