2012-09-27 14:15:27 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/vstudio/cs2005/test_assembly_refs.lua
|
|
|
|
-- Test the assembly linking block of a Visual Studio 2005+ C# project.
|
|
|
|
-- Copyright (c) 2012 Jason Perkins and the Premake project
|
|
|
|
--
|
|
|
|
|
|
|
|
T.vstudio_cs2005_assembly_refs = {}
|
|
|
|
local suite = T.vstudio_cs2005_assembly_refs
|
|
|
|
local cs2005 = premake.vstudio.cs2005
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup and teardown
|
|
|
|
--
|
|
|
|
|
|
|
|
local sln, prj
|
2013-01-10 16:09:34 +00:00
|
|
|
|
2012-09-27 14:15:27 +00:00
|
|
|
function suite.setup()
|
|
|
|
_ACTION = "vs2008"
|
|
|
|
sln = test.createsolution()
|
|
|
|
language "C#"
|
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare(platform)
|
|
|
|
prj = premake.solution.getproject_ng(sln, 1)
|
2012-10-10 15:09:51 +00:00
|
|
|
cs2005.assemblyReferences(prj)
|
2012-09-27 14:15:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Block should be empty if the project has no links.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.emptyGroup_onNoLinks()
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ItemGroup>
|
|
|
|
</ItemGroup>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of system assemblies.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.assemblyRef_onSystemAssembly()
|
|
|
|
links { "System" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ItemGroup>
|
|
|
|
<Reference Include="System" />
|
|
|
|
</ItemGroup>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Assemblies referenced by a path should get a hint.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.assemblyRef_onPath()
|
|
|
|
links { "../Libraries/nunit.framework" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ItemGroup>
|
|
|
|
<Reference Include="nunit.framework">
|
|
|
|
<HintPath>..\Libraries\nunit.framework.dll</HintPath>
|
|
|
|
</Reference>
|
|
|
|
</ItemGroup>
|
|
|
|
]]
|
2013-01-10 16:09:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Assemblies referenced via a token that expands to an absolute
|
|
|
|
-- path should still end up with a relative hint path.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.assemblyRef_onAbsoluteToken()
|
|
|
|
links { "%{path.getdirectory(os.getcwd())}/Libraries/nunit.framework" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ItemGroup>
|
|
|
|
<Reference Include="nunit.framework">
|
|
|
|
<HintPath>..\Libraries\nunit.framework.dll</HintPath>
|
|
|
|
</Reference>
|
|
|
|
</ItemGroup>
|
|
|
|
]]
|
|
|
|
end
|