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

test_files.lua « cs2005 « vstudio « actions « tests - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 01e7f444edb9785f4a602245d8075a9d676720c6 (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
--
-- tests/actions/vstudio/cs2005/test_files.lua
-- Validate generation of <Files/> block in Visual Studio 2005 .csproj
-- Copyright (c) 2009-2012 Jason Perkins and the Premake project
--

	T.vstudio_cs2005_files = { }
	local suite = T.vstudio_cs2005_files
	local cs2005 = premake.vstudio.cs2005


--
-- Setup 
--

	local sln, prj
	
	function suite.setup()
		sln = test.createsolution()
	end
	
	local function prepare()
		premake.bake.buildconfigs()
		prj = premake.solution.getproject(sln, 1)
		sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
		cs2005.files(prj)
	end


--
-- Test grouping and nesting
--

	function suite.SimpleSourceFile()
		files { "Hello.cs" }
		prepare()
		test.capture [[
    <Compile Include="Hello.cs" />
		]]
	end

	function suite.NestedSourceFile()
		files { "Src/Hello.cs" }
		prepare()
		test.capture [[
    <Compile Include="Src\Hello.cs" />
		]]
	end


--
-- The relative path to the file is correct for files that live outside
-- the project's folder.
--

	function suite.filesUseRelativePath_onOutOfTreePath()
		files { "../Src/Hello.cs" }
		prepare()
		test.capture [[
    <Compile Include="..\Src\Hello.cs" />
		]]
	end


--
-- Test file dependencies
--

	function suite.SimpleResourceDependency()
		files { "Resources.resx", "Resources.Designer.cs" }
		prepare()
		test.capture [[
    <Compile Include="Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <EmbeddedResource Include="Resources.resx">
      <SubType>Designer</SubType>
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
		]]
	end