1-- 2-- tests/actions/vstudio/vc2010/test_compile_settings.lua 3-- Validate compiler settings in Visual Studio 2019 C/C++ projects. 4-- Copyright (c) 2011-2020 Jason Perkins and the Premake project 5-- 6 7 local p = premake 8 local suite = test.declare("vstudio_vs2019_toolset_settings") 9 local vc2010 = p.vstudio.vc2010 10 local project = p.project 11 12-- 13-- Setup 14-- 15 16 local wks, prj 17 18 function suite.setup() 19 p.action.set("vs2019") 20 wks, prj = test.createWorkspace() 21 end 22 23 local function prepare(platform) 24 local cfg = test.getconfig(prj, "Debug", platform) 25 vc2010.configurationProperties(cfg) 26 end 27 28--- 29-- Check the default project settings 30--- 31 32 function suite.defaultSettings() 33 prepare() 34 test.capture [[ 35<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> 36 <ConfigurationType>Application</ConfigurationType> 37 <UseDebugLibraries>false</UseDebugLibraries> 38 <CharacterSet>Unicode</CharacterSet> 39 <PlatformToolset>v142</PlatformToolset> 40</PropertyGroup> 41 ]] 42 end 43 44--- 45-- Check the project settings with the clang toolset 46--- 47 48 function suite.toolsetClang() 49 toolset "clang" 50 prepare() 51 test.capture [[ 52<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> 53 <ConfigurationType>Application</ConfigurationType> 54 <UseDebugLibraries>false</UseDebugLibraries> 55 <CharacterSet>Unicode</CharacterSet> 56 <PlatformToolset>ClangCL</PlatformToolset> 57</PropertyGroup> 58 ]] 59 end 60