This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/modules/vstudio/tests/vc2010/test_project_refs.lua

117 lines
2.6 KiB
Lua
Raw Normal View History

2012-02-01 00:54:33 +00:00
--
-- tests/actions/vstudio/vc2010/test_project_refs.lua
-- Validate project references in Visual Studio 2010 C/C++ projects.
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project
--
2017-04-25 05:44:13 +00:00
local p = premake
local suite = test.declare("vstudio_vs2010_project_refs")
2017-04-25 05:44:13 +00:00
local vc2010 = p.vstudio.vc2010
2012-02-01 00:54:33 +00:00
--
-- Setup
--
2015-08-28 20:16:14 +00:00
local wks, prj
2012-02-01 00:54:33 +00:00
function suite.setup()
2017-04-25 05:44:13 +00:00
p.action.set("vs2010")
2015-08-28 20:16:14 +00:00
wks = test.createWorkspace()
2012-02-01 00:54:33 +00:00
uuid "00112233-4455-6677-8888-99AABBCCDDEE"
2015-08-28 20:16:14 +00:00
test.createproject(wks)
2012-02-01 00:54:33 +00:00
end
local function prepare(platform)
prj = test.getproject(wks, 2)
vc2010.projectReferences(prj)
2012-02-01 00:54:33 +00:00
end
--
-- If there are no sibling projects listed in links(), then the
-- entire project references item group should be skipped.
--
function suite.noProjectReferencesGroup_onNoSiblingReferences()
prepare()
test.isemptycapture()
end
--
-- If a sibling project is listed in links(), an item group should
-- be written with a reference to that sibling project.
--
function suite.projectReferenceAdded_onSiblingProjectLink()
links { "MyProject" }
prepare()
test.capture [[
<ItemGroup>
<ProjectReference Include="MyProject.vcxproj">
<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
</ProjectReference>
</ItemGroup>
2012-02-01 00:54:33 +00:00
]]
end
--
-- Project references should always be specified relative to the
-- project doing the referencing.
--
function suite.referencesAreRelative_onDifferentProjectLocation()
links { "MyProject" }
location "build/MyProject2"
project("MyProject")
location "build/MyProject"
prepare()
test.capture [[
<ItemGroup>
<ProjectReference Include="..\MyProject\MyProject.vcxproj">
<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
</ProjectReference>
</ItemGroup>
]]
end
--
-- Managed C++ projects write out references a little differently.
--
function suite.referencesAreRelative_onDifferentProjectLocationWithCLR()
links { "MyProject" }
clr "On"
prepare()
test.capture [[
<ItemGroup>
<ProjectReference Include="MyProject.vcxproj">
<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
]]
end
--
-- Shared items projects are referenced differently
--
function suite.sharedItemsProjects()
links { "MyProject" }
project("MyProject")
kind "SharedItems"
prepare()
test.capture [[
<ImportGroup Label="Shared">
<Import Project="MyProject.vcxitems" Label="Shared" />
</ImportGroup>
]]
end