From 66619d39d54023c9ba2953b513302ce515797e6b Mon Sep 17 00:00:00 2001 From: liamDevine Date: Thu, 17 Mar 2011 04:17:36 +0000 Subject: added specialisation for terms in mergeobject kind seems special. it gets set in the cfg and is needed by the terms yet not added automatically added a check when iterating blocks in merge to see if kind needs adding to terms changed getactiveterms so it doesn't use number keys at end of merge, added a merging of terms into cfg.terms terms were being shared between all configurations in collapse. NOTE : it may still need looking at for when the platform is not native. changed to use a local copy, this gets updated instead. --- tests/base/test_config_bug.lua | 145 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 tests/base/test_config_bug.lua (limited to 'tests/base') diff --git a/tests/base/test_config_bug.lua b/tests/base/test_config_bug.lua new file mode 100644 index 0000000..5ef79e1 --- /dev/null +++ b/tests/base/test_config_bug.lua @@ -0,0 +1,145 @@ + T.config_bug_report = { } + local config_bug = T.config_bug_report + local vs10_helpers = premake.vstudio.vs10_helpers + + local sln, prjA,prjB,prjC,prjD + function config_bug.teardown() + sln = nil + prjA = nil + prjB = nil + prjC = nil + prjD = nil + end + + function config_bug.setup() + end + + + + local config_bug_updated = function () + + local setCommonLibraryConfig = function() + configuration "Debug or Release" + kind "StaticLib" + + configuration "DebugDLL or ReleaseDLL" + kind "SharedLib" + end + + sln = solution "Test" + configurations { "Debug", "Release", "DebugDLL", "ReleaseDLL" } + language "C++" + + prjA = project "A" + files { "a.cpp" } + setCommonLibraryConfig() + prjB = project "B" + files { "b.cpp" } + setCommonLibraryConfig() + configuration "SharedLib" + links { "A" } + prjC = project "C" + files { "c.cpp" } + setCommonLibraryConfig() + configuration "SharedLib" + links { "A", "B" } + prjD = project "Executable" + kind "WindowedApp" + links { "A", "B", "C" } + + end + + local kindSetOnConfiguration_and_linkSetOnSharedLibProjB = function (config_kind) + sln = solution "DontCare" + configurations { "DebugDLL"} + + configuration "DebugDLL" + kind(config_kind) + prjA = project "A" + prjB = project "B" + configuration { config_kind } + links { "A" } + end + + local sharedLibKindSetOnProject_and_linkSetOnSharedLibProjB = function () + sln = solution "DontCare" + configurations { "DebugDLL" } + project "A" + prjB = project "B" + configuration "DebugDLL" + kind "SharedLib" + configuration "SharedLib" + links { "A" } + defines {"defineSet"} + + end + + + function kind_set_on_project_config_block() + sln = solution "DontCare" + configurations { "DebugDLL" } + local A = project "A" + configuration "DebugDLL" + kind "SharedLib" + defines {"defineSet"} + return A + end + + + function config_bug.bugUpdated_prjBLinksContainsA() + config_bug_updated() + premake.buildconfigs() + local conf = premake.getconfig(prjB,"DebugDLL","Native") + test.isnotnil(conf.links.A) + end + + + function config_bug.kindSetOnProjectConfigBlock_projKindEqualsSharedLib() + local proj = kind_set_on_project_config_block() + premake.buildconfigs() + local conf = premake.getconfig(proj,"DebugDLL","Native") + test.isequal("SharedLib",conf.kind) + end + + function config_bug.defineSetOnProjectConfigBlock_projDefineSetIsNotNil() + local proj = kind_set_on_project_config_block() + premake.buildconfigs() + local conf = premake.getconfig(proj,"DebugDLL","Native") + test.isnotnil(conf.defines.defineSet) + end + + function config_bug.defineSetInBlockInsideProject () + sharedLibKindSetOnProject_and_linkSetOnSharedLibProjB() + premake.buildconfigs() + local conf = premake.getconfig(prjB,"DebugDLL","Native") + test.isnotnil(conf.defines.defineSet) + end + + + function config_bug.whenKindSetOnProject_PrjBLinksContainsA() + sharedLibKindSetOnProject_and_linkSetOnSharedLibProjB() + premake.buildconfigs() + local conf = premake.getconfig(prjB,"DebugDLL","Native") + test.isnotnil(conf.links.A) + end + + + + + + function config_bug.whenKindSetOnConfiguration_prjBLinksContainsA_StaticLib() +-- sharedLibKindSetOnConfiguration_and_linkSetOnSharedLibProjB() + kindSetOnConfiguration_and_linkSetOnSharedLibProjB("StaticLib") + premake.buildconfigs() + local config = premake.getconfig(prjB,"DebugDLL","Native") + test.isnotnil(config.links.A) + end + + function config_bug.whenKindSetOnConfiguration_prjBLinksContainsA() +-- sharedLibKindSetOnConfiguration_and_linkSetOnSharedLibProjB() + kindSetOnConfiguration_and_linkSetOnSharedLibProjB("SharedLib") + premake.buildconfigs() + local config = premake.getconfig(prjB,"DebugDLL","Native") + test.isnotnil(config.links.A) + end + \ No newline at end of file -- cgit v1.2.3