forked from premake/premake-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_target_name.lua
More file actions
128 lines (94 loc) · 2.35 KB
/
test_target_name.lua
File metadata and controls
128 lines (94 loc) · 2.35 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
--
-- test_target_name.lua
-- Test target names.
-- Author: Nick Clark
-- Copyright (c) 2026 Jess Perkins and the Premake project
--
local p = premake
local suite = test.declare("vstudio_vs2010_target_name")
local vc2010 = p.vstudio.vc2010
--
-- Setup
--
local wks, prj
function suite.setup()
p.action.set("vs2010")
wks, prj = test.createWorkspace()
end
local function prepare(platform)
local cfg = test.getconfig(prj, "Debug", platform)
vc2010.targetName(cfg)
end
--
-- Default target name is the project name
--
function suite.defaultTargetName()
prepare()
test.capture [[
<TargetName>MyProject</TargetName>
]]
end
function suite.targetWithSuffix()
targetsuffix "_suffix"
prepare()
test.capture [[
<TargetName>MyProject_suffix</TargetName>
]]
end
--
-- Target name with targetsuffix with AARCH architecture
--
function suite.targetWithAarch64FilterSuffix()
architecture "AARCH64"
filter { "architecture:AARCH64" } -- Fails if it is set to ARM64
targetsuffix "_ARM64"
prepare()
test.capture [[
<TargetName>MyProject_ARM64</TargetName>
]]
end
--
-- Target name with targetsuffix with ARM64 architecture
--
function suite.targetWithArm64FilterSuffix()
architecture "ARM64"
filter { "architecture:ARM64" } -- Should match when architecture is AARCH64
targetsuffix "_ARM64"
prepare()
test.capture [[
<TargetName>MyProject_ARM64</TargetName>
]]
end
--
-- Target name with targetsuffix and x64 architecture
--
function suite.targetWithX64FilterSuffix()
architecture "x64"
filter { "architecture:x64" }
targetsuffix "_x64"
prepare()
test.capture [[
<TargetName>MyProject_x64</TargetName>
]]
end
--
-- Target name with targetprefix
--
function suite.targetWithPrefix()
targetprefix "lib"
prepare()
test.capture [[
<TargetName>libMyProject</TargetName>
]]
end
--
-- Target name with targetprefix and targetsuffix
--
function suite.targetWithPrefixAndSuffix()
targetprefix "lib"
targetsuffix "_suffix"
prepare()
test.capture [[
<TargetName>libMyProject_suffix</TargetName>
]]
end