Skip to content

Commit 4ae10aa

Browse files
authored
Improve slnx format output (#2653)
* Improve slnx format output
1 parent 03a49dc commit 4ae10aa

2 files changed

Lines changed: 231 additions & 143 deletions

File tree

modules/vstudio/tests/sln2026/test_projects.lua

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ function suite.setup()
1414
p.action.set("vs2026")
1515
end
1616

17+
function prepare(wks)
18+
wks = test.getWorkspace(wks)
19+
sln2026.projects(wks)
20+
end
1721

1822
function suite.single_project()
1923
local wks = workspace "MyWorkspace"
2024
local prj = project "MyProject"
21-
uuid "AE61726D-187C-E440-BD07-2556188A6565"
22-
23-
sln2026.projects(wks)
25+
uuid "AE61726D-187C-E440-BD07-2556188A6565"
26+
prepare(wks)
2427

2528
test.capture [[
2629
<Project Path="MyProject.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
@@ -38,7 +41,7 @@ function suite.multiple_projects_no_dependencies()
3841
local prj2 = project "MyProject2"
3942
uuid "BE62726D-187C-E440-BD07-2556188A6565"
4043

41-
sln2026.projects(wks)
44+
prepare(wks)
4245

4346
test.capture [[
4447
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
@@ -64,12 +67,20 @@ function suite.multiple_projects_with_dependency()
6467
language "C++"
6568
kind "StaticLib"
6669

67-
sln2026.projects(wks)
70+
prepare(wks)
6871

6972
test.capture [[
7073
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
74+
<BuildType Solution="Debug|Win32" Project="Debug" />
75+
<BuildType Solution="Release|Win32" Project="Release" />
76+
<Platform Solution="Debug|Win32" Project="Win32" />
77+
<Platform Solution="Release|Win32" Project="Win32" />
7178
</Project>
7279
<Project Path="MyProject2.vcxproj" Id="BE62726D-187C-E440-BD07-2556188A6565">
80+
<BuildType Solution="Debug|Win32" Project="Debug" />
81+
<BuildType Solution="Release|Win32" Project="Release" />
82+
<Platform Solution="Debug|Win32" Project="Win32" />
83+
<Platform Solution="Release|Win32" Project="Win32" />
7384
<BuildDependency Project="MyProject1.vcxproj" />
7485
</Project>
7586
]]
@@ -79,22 +90,33 @@ function suite.project_in_groups()
7990
local wks = workspace "MyWorkspace"
8091
configurations { "Debug", "Release" }
8192

82-
local grp1 = group "Group1"
83-
8493
local prj1 = project "MyProject1"
8594
uuid "AE61726D-187C-E440-BD07-2556188A6565"
8695

87-
sln2026.projects(wks)
96+
local grp1 = group "Group1"
97+
local prj2 = project "MyProject2"
98+
uuid "BE61726D-187C-E440-BD07-2556188A6565"
99+
100+
prepare(wks)
88101

89102
test.capture [[
103+
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
104+
<BuildType Solution="Debug|Win32" Project="Debug" />
105+
<BuildType Solution="Release|Win32" Project="Release" />
106+
<Platform Solution="Debug|Win32" Project="Win32" />
107+
<Platform Solution="Release|Win32" Project="Win32" />
108+
</Project>
90109
<Folder Name="/Group1/">
91-
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
110+
<Project Path="MyProject2.vcxproj" Id="BE61726D-187C-E440-BD07-2556188A6565">
111+
<BuildType Solution="Debug|Win32" Project="Debug" />
112+
<BuildType Solution="Release|Win32" Project="Release" />
113+
<Platform Solution="Debug|Win32" Project="Win32" />
114+
<Platform Solution="Release|Win32" Project="Win32" />
92115
</Project>
93116
</Folder>
94117
]]
95118
end
96119

97-
98120
function suite.project_with_configmap()
99121
local wks = workspace "MyWorkspace"
100122
configurations { "Debug", "Release", "SpecialRelease" }
@@ -107,13 +129,16 @@ function suite.project_with_configmap()
107129
[ "Debug" ] = "Debug",
108130
}
109131

110-
sln2026.projects(wks)
132+
prepare(wks)
111133

112134
test.capture [[
113135
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
114-
<BuildType Solution="Debug|*" Project="Debug" />
115-
<BuildType Solution="Release|*" Project="Release" />
116-
<BuildType Solution="SpecialRelease|*" Project="Release" />
136+
<BuildType Solution="Debug|Win32" Project="Debug" />
137+
<BuildType Solution="Release|Win32" Project="Release" />
138+
<BuildType Solution="SpecialRelease|Win32" Project="Release" />
139+
<Platform Solution="Debug|Win32" Project="Win32" />
140+
<Platform Solution="Release|Win32" Project="Win32" />
141+
<Platform Solution="SpecialRelease|Win32" Project="Win32" />
117142
</Project>
118143
]]
119144
end
@@ -129,11 +154,16 @@ function suite.project_with_single_configmap()
129154
[ "SpecialRelease" ] = "Release",
130155
}
131156

132-
sln2026.projects(wks)
157+
prepare(wks)
133158

134159
test.capture [[
135160
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
136-
<BuildType Solution="SpecialRelease|*" Project="Release" />
161+
<BuildType Solution="Debug|Win32" Project="Debug" />
162+
<BuildType Solution="Release|Win32" Project="Release" />
163+
<BuildType Solution="SpecialRelease|Win32" Project="Release" />
164+
<Platform Solution="Debug|Win32" Project="Win32" />
165+
<Platform Solution="Release|Win32" Project="Win32" />
166+
<Platform Solution="SpecialRelease|Win32" Project="Win32" />
137167
</Project>
138168
]]
139169
end
@@ -150,11 +180,18 @@ function suite.project_with_platform_configmap()
150180
[ "MyPlatform" ] = "x64",
151181
}
152182

153-
sln2026.projects(wks)
183+
prepare(wks)
154184

155185
test.capture [[
156186
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
157-
<Platform Solution="*|MyPlatform" Project="x64" />
187+
<BuildType Solution="Debug|MyPlatform" Project="Debug" />
188+
<BuildType Solution="Debug|x64" Project="Debug" />
189+
<BuildType Solution="Release|MyPlatform" Project="Release" />
190+
<BuildType Solution="Release|x64" Project="Release" />
191+
<Platform Solution="Debug|MyPlatform" Project="x64" />
192+
<Platform Solution="Debug|x64" Project="x64" />
193+
<Platform Solution="Release|MyPlatform" Project="x64" />
194+
<Platform Solution="Release|x64" Project="x64" />
158195
</Project>
159196
]]
160197
end
@@ -171,12 +208,18 @@ function suite.project_with_platform_and_config_configmap()
171208
[ { "Debug", "MyPlatform" } ] = { "Debug", "x64" },
172209
}
173210

174-
sln2026.projects(wks)
211+
prepare(wks)
175212

176213
test.capture [[
177214
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
178-
<Platform Solution="Debug|MyPlatform" Project="x64" />
179215
<BuildType Solution="Debug|MyPlatform" Project="Debug" />
216+
<BuildType Solution="Debug|x64" Project="Debug" />
217+
<BuildType Solution="Release|MyPlatform" Project="Release MyPlatform" />
218+
<BuildType Solution="Release|x64" Project="Release" />
219+
<Platform Solution="Debug|MyPlatform" Project="x64" />
220+
<Platform Solution="Debug|x64" Project="x64" />
221+
<Platform Solution="Release|MyPlatform" Project="Win32" />
222+
<Platform Solution="Release|x64" Project="x64" />
180223
</Project>
181224
]]
182225
end
@@ -191,10 +234,14 @@ function suite.project_excluded_from_build()
191234
filter "configurations:Release"
192235
excludefrombuild "On"
193236

194-
sln2026.projects(wks)
237+
prepare(wks)
195238

196239
test.capture [[
197240
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
241+
<BuildType Solution="Debug|Win32" Project="Debug" />
242+
<BuildType Solution="Release|Win32" Project="Release" />
243+
<Platform Solution="Debug|Win32" Project="Win32" />
244+
<Platform Solution="Release|Win32" Project="Win32" />
198245
<Build Solution="Release|Win32" Project="false" />
199246
</Project>
200247
]]
@@ -209,11 +256,16 @@ function suite.project_remove_configuration()
209256
uuid "AE61726D-187C-E440-BD07-2556188A6565"
210257
removeconfigurations { "Release" }
211258

212-
sln2026.projects(wks)
259+
prepare(wks)
213260

214261
test.capture [[
215262
<Project Path="MyProject1.vcxproj" Id="AE61726D-187C-E440-BD07-2556188A6565">
216-
<Build Solution="Release|Win32" Project="false" />
263+
<BuildType Solution="Debug|Win32" Project="Debug" />
264+
<BuildType Project="Debug" />
265+
<Platform Solution="Debug|Win32" Project="Win32" />
266+
<Platform Project="Win32" />
267+
<Build Solution="Debug|Win32" Project="true" />
268+
<Build Project="false" />
217269
</Project>
218270
]]
219271
end

0 commit comments

Comments
 (0)