2012-09-27 16:18:03 +00:00
|
|
|
--
|
|
|
|
-- tests/tools/test_dotnet.lua
|
|
|
|
-- Automated test suite for the .NET toolset interface.
|
2013-11-14 13:52:55 +00:00
|
|
|
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project
|
2012-09-27 16:18:03 +00:00
|
|
|
--
|
|
|
|
|
2017-04-25 05:44:13 +00:00
|
|
|
local p = premake
|
2013-11-14 13:52:55 +00:00
|
|
|
local suite = test.declare("tools_dotnet")
|
2017-04-25 05:44:13 +00:00
|
|
|
local dotnet = p.tools.dotnet
|
2012-09-27 16:18:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup/teardown
|
|
|
|
--
|
|
|
|
|
2015-08-28 20:16:14 +00:00
|
|
|
local wks, prj, cfg
|
2012-09-27 16:18:03 +00:00
|
|
|
|
|
|
|
function suite.setup()
|
2015-08-28 20:16:14 +00:00
|
|
|
wks, prj = test.createWorkspace()
|
2012-09-27 16:18:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare()
|
2013-11-14 13:52:55 +00:00
|
|
|
cfg = test.getconfig(prj, "Debug")
|
2012-09-27 16:18:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- On Windows, use Microsoft's CSC compiler by default.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.defaultCompiler_onWindows()
|
2017-04-11 20:39:25 +00:00
|
|
|
_TARGET_OS = "windows"
|
2012-09-27 16:18:03 +00:00
|
|
|
prepare()
|
|
|
|
test.isequal("csc", dotnet.gettoolname(cfg, "csc"))
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Everywhere other than Windows, use Mono by default.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.defaultCompiler_onMacOSX()
|
2017-04-11 20:39:25 +00:00
|
|
|
_TARGET_OS = "macosx"
|
2012-09-27 16:18:03 +00:00
|
|
|
prepare()
|
2019-02-18 16:21:05 +00:00
|
|
|
test.isequal("csc", dotnet.gettoolname(cfg, "csc"))
|
2012-09-27 16:18:03 +00:00
|
|
|
end
|
2019-02-18 12:37:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check support for the `csversion` API
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.flags_csversion()
|
|
|
|
prepare()
|
|
|
|
csversion "7.2"
|
|
|
|
test.contains({ "/langversion:7.2" }, dotnet.getflags(cfg))
|
|
|
|
end
|