premake/tests/tools/test_msc.lua
2012-08-18 16:33:37 -04:00

51 lines
912 B
Lua

--
-- 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 = premake5.project
--
-- Setup/teardown
--
local sln, prj, cfg
function suite.setup()
sln = test.createsolution()
kind "StaticLib"
end
local function prepare()
prj = premake.solution.getproject_ng(sln, 1)
cfg = premake5.project.getconfig(prj, "Debug")
end
--
-- Check handling of basic linker flags.
--
function suite.ldflags_onSymbols()
flags { "Symbols" }
prepare()
test.isequal({ "/DEBUG" }, msc.getldflags(cfg))
end
--
-- Check handling of library search paths.
--
function suite.libdirs_onLibdirs()
libdirs { "../libs", "libs" }
prepare()
test.isequal({ '/LIBPATH:"../libs"', '/LIBPATH:"libs"' }, msc.getldflags(cfg))
end