This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/tests/actions/vstudio/vc2010/test_project_configs.lua
Jason Perkins 17f1843c71 Finish renaming architectures away from x32/x64
A number of tests were relying on the fact that x32/x64 were being converted implicitly to x86/x86_64. If/when we retire those symbols, all of those tests would break. Renamed them now to avoid having to sort it out later. Also fixed up comments to keep everything consistent.
2015-04-13 18:27:11 -04:00

106 lines
2.8 KiB
Lua
Executable File

--
-- tests/actions/vstudio/vc2010/test_project_configs.lua
-- Test the Visual Studio 2010 project configurations item group.
-- Copyright (c) 2009-2014 Jason Perkins and the Premake project
--
local suite = test.declare("vstudio_vc2010_project_configs")
local vc2010 = premake.vstudio.vc2010
--
-- Setup
--
local sln, prj
function suite.setup()
_ACTION = "vs2010"
sln = test.createsolution()
end
local function prepare()
prj = premake.solution.getproject(sln, 1)
vc2010.projectConfigurations(prj)
end
--
-- If no architectures are specified, Win32 should be the default.
--
function suite.win32Listed_onNoPlatforms()
prepare()
test.capture [[
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
]]
end
--
-- Visual Studio requires that all combinations of configurations and
-- architectures be listed (even if some pairings would make no sense
-- for our build, i.e. Win32 DLL DCRT|PS3).
--
function suite.allArchitecturesListed_onMultipleArchitectures()
platforms { "32b", "64b" }
filter "platforms:32b"
architecture "x86"
filter "platforms:64b"
architecture "x86_64"
prepare()
test.capture [[
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug 32b|Win32">
<Configuration>Debug 32b</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug 32b|x64">
<Configuration>Debug 32b</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug 64b|Win32">
<Configuration>Debug 64b</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug 64b|x64">
<Configuration>Debug 64b</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release 32b|Win32">
]]
end
--
-- Sometimes unrolling the configuration-architecture combinations
-- can cause duplicates. Make sure those get removed.
--
function suite.allArchitecturesListed_onImplicitArchitectures()
platforms { "x86", "x86_64" }
prepare()
test.capture [[
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
]]
end