Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliamDevine <none@none>2011-03-17 07:17:36 +0300
committerliamDevine <none@none>2011-03-17 07:17:36 +0300
commit66619d39d54023c9ba2953b513302ce515797e6b (patch)
tree70bab0bcd687189c5d7d1a1df12fe52ce7c3cff9 /tests/base
parentd212e79b7598c68974f87cb0baa81eec2382028a (diff)
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.
Diffstat (limited to 'tests/base')
-rw-r--r--tests/base/test_config_bug.lua145
1 files changed, 145 insertions, 0 deletions
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