--
-- tests/test_msc.lua
-- Automated test suite for the Microsoft C toolset interface.
-- Copyright (c) 2012 Jason Perkins and the Premake project
T.tools_msc = { }
local suite = T.tools_msc
local msc = premake.tools.msc
local project = premake.project
-- Setup/teardown
local sln, prj, cfg
function suite.setup()
sln = test.createsolution()
kind "StaticLib"
end
local function prepare()
prj = premake.solution.getproject(sln, 1)
cfg = project.getconfig(prj, "Debug")
-- Check handling of basic linker flags.
function suite.ldflags_onSymbols()
flags { "Symbols" }
prepare()
test.isequal({ "/DEBUG" }, msc.getldflags(cfg))
-- Check handling of library search paths.
function suite.libdirs_onLibdirs()
libdirs { "../libs", "libs" }
test.isequal({ '/LIBPATH:"../libs"', '/LIBPATH:"libs"' }, msc.getldflags(cfg))
-- Check handling of forced includes.
function suite.forcedIncludeFiles()
forceincludes { "stdafx.h", "include/sys.h" }
test.isequal({'/FIstdafx.h', '/FIinclude/sys.h'}, msc.getforceincludes(cfg))