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/tools/test_dotnet.lua

58 lines
1019 B
Lua
Raw Normal View History

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