--
-- tests/test_gmake_cs.lua
-- Automated test suite for GNU Make C/C++ project generation.
-- Copyright (c) 2009 Jason Perkins and the Premake project
T.gmake_cs = { }
-- Configure a solution for testing
local sln, prj
function T.gmake_cs.setup()
_ACTION = "gmake"
_OPTIONS.os = "linux"
sln = solution "MySolution"
configurations { "Debug", "Release" }
platforms { "Native" }
prj = project "MyProject"
language "C#"
kind "ConsoleApp"
end
local function prepare()
premake.bake.buildconfigs()
-- Test configuration blocks
function T.gmake_cs.BasicCfgBlock()
prepare()
local cfg = premake.getconfig(prj, "Debug")
premake.gmake_cs_config(cfg, premake.dotnet, {[cfg]={}})
test.capture [[
ifneq (,$(findstring debug,$(config)))
TARGETDIR := .
OBJDIR := obj/Debug
DEPENDS :=
REFERENCES :=
FLAGS +=
define PREBUILDCMDS
endef
define PRELINKCMDS
define POSTBUILDCMDS
endif
]]
function T.gmake_cs.OnBuildOptions()
buildoptions { "/define:SYMBOL" }
FLAGS += /define:SYMBOL