Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_links.lua « vc2010 « vstudio « actions « tests - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9d5c0d21cb3cc3313355c9d7cb14623f21859290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
--
-- tests/actions/vstudio/vc2010/test_links.lua
-- Validate linking and project references in Visual Studio 2010 C/C++ projects.
-- Copyright (c) 2011 Jason Perkins and the Premake project
--

	T.vstudio_vs2010_links = { }
	local suite = T.vstudio_vs2010_links
	local vc2010 = premake.vstudio.vc2010


--
-- Setup
--

	local sln, prj, prj2

	function suite.setup()
		os_uuid = os.uuid
		os.uuid = function() return "00112233-4455-6677-8888-99AABBCCDDEE" end

		sln = test.createsolution()
		test.createproject(sln)
	end

	local function prepare()
		premake.bake.buildconfigs()
		prj = premake.solution.getproject(sln, 1)
		prj2 = premake.solution.getproject(sln, 2)
		sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
	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()
		vc2010.projectReferences(prj2)
		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()
		vc2010.projectReferences(prj2)
		test.capture [[
	<ItemGroup>
		<ProjectReference Include="MyProject.vcproj">
			<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
		</ProjectReference>
	</ItemGroup>
		]]
	end


--
-- If a sibling library is listed in links(), it should NOT appear in
-- the additional dependencies element. Visual Studio will figure that
-- out from the project reference item group.
--

	function suite.noDependencies_onOnlySiblingProjectLinks()
		links { "MyProject" }
		prepare()
		vc2010.additionalDependencies(prj2)
		test.isemptycapture()
	end


--
-- If a mix of sibling and system links are listed, only the system
-- libraries should appear in the additional dependencies element.
--

	function suite.onlySystemDependencies_OnSiblingProjectLink()
		links { "MyProject", "kernel32" }
		prepare()
		vc2010.additionalDependencies(prj2)
		test.capture [[
			<AdditionalDependencies>kernel32;%(AdditionalDependencies)</AdditionalDependencies>
		]]
	end