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

test_xcode_common.lua « xcode « actions « tests - github.com/windirstat/premake-4.x.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1f7fa2a2d49d32b4707043a2a0b8388bee0d7f0d (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
--
-- tests/actions/xcode/test_xcode_common.lua
-- Automated test suite for functions shared between Xcode projects and solutions
-- Copyright (c) 2009 Jason Perkins and the Premake project
--

	T.xcode3common = { }

	local suite = T.xcode3common
	local xcode = premake.xcode


--
-- Replacement for xcode.newid(). Creates a synthetic ID based on the node name,
-- its intended usage (file ID, build ID, etc.) and its place in the tree. This 
-- makes it easier to tell if the right ID is being used in the right places.
--

	xcode.used_ids = {}
	
	xcode.newid = function(node, usage)
		local name = node.name
		if usage then
			name = name .. ":" .. usage
		end
		
		if xcode.used_ids[name] then
			local count = xcode.used_ids[name] + 1
			xcode.used_ids[name] = count
			name = name .. "(" .. count .. ")"
		else
			xcode.used_ids[name] = 1
		end
		
		return "[" .. name .. "]"
	end


---------------------------------------------------------------------------
-- Header/footer tests
---------------------------------------------------------------------------

	function suite.Header_IsCorrect()
		xcode.Header()
		test.capture [[
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 45;
	objects = {

		]]
	end


	function suite.Footer()
		xcode.Footer()
		test.capture [[
	};
	rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}
		]]
	end