diff options
author | Jason Perkins <starkos@industriousone.com> | 2011-02-02 21:27:52 +0300 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2011-02-02 21:27:52 +0300 |
commit | 543ea0f871fc4c4ef6bf75e0e84b8350983b1e30 (patch) | |
tree | d3490813c856dcb97cc8ea9147fa60007edd2312 /tests | |
parent | db206979560b944fe06ab6e96ca0898131ed1028 (diff) |
Cleaned up and standardized namespaces in vstudio code
Diffstat (limited to 'tests')
-rw-r--r-- | tests/actions/vstudio/test_vs200x_vcproj.lua | 48 | ||||
-rwxr-xr-x | tests/actions/vstudio/test_vs200x_vcproj_linker.lua | 14 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs2010_filters.lua | 84 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs2010_flags.lua | 202 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs2010_links.lua | 36 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs2010_project_kinds.lua | 34 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs2010_vcxproj.lua | 18 | ||||
-rw-r--r-- | tests/actions/vstudio/vs200x/files.lua | 6 | ||||
-rw-r--r-- | tests/test_vs2002_sln.lua | 8 | ||||
-rw-r--r-- | tests/test_vs2003_sln.lua | 8 | ||||
-rw-r--r-- | tests/test_vs2005_sln.lua | 38 | ||||
-rw-r--r-- | tests/test_vs2008_sln.lua | 8 |
12 files changed, 256 insertions, 248 deletions
diff --git a/tests/actions/vstudio/test_vs200x_vcproj.lua b/tests/actions/vstudio/test_vs200x_vcproj.lua index 1348230..0bbfd3a 100644 --- a/tests/actions/vstudio/test_vs200x_vcproj.lua +++ b/tests/actions/vstudio/test_vs200x_vcproj.lua @@ -6,7 +6,7 @@ T.vs200x_vcproj = { } local suite = T.vs200x_vcproj - local vcproj = premake.vstudio.vcproj + local vc200x = premake.vstudio.vc200x -- @@ -34,7 +34,7 @@ local function prepare() io.capture() premake.buildconfigs() - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) local cfg = premake.getconfig(sln.projects[2]) cfg.name = prj.name @@ -49,7 +49,7 @@ function suite.BasicLayout() prepare() - premake.vs200x_vcproj(prj) + vc200x.generate(prj) test.capture [[ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject @@ -243,7 +243,7 @@ function suite.Configuration_OnMFCFlag() flags { "MFC" } prepare() - vcproj.Configuration("Debug|Win32", premake.getconfig(prj, "Debug")) + vc200x.Configuration("Debug|Win32", premake.getconfig(prj, "Debug")) test.capture [[ <Configuration Name="Debug|Win32" @@ -265,7 +265,7 @@ platforms { "x32", "x64" } prepare() - premake.vs200x_vcproj(prj) + vc200x.generate(prj) local result = io.endcapture() test.istrue(result:find '<Configuration\r\n\t\t\tName="Debug|Win32"\r\n') test.istrue(result:find '<Configuration\r\n\t\t\tName="Release|Win32"\r\n') @@ -282,7 +282,7 @@ function suite.PlatformsList_OnX64() platforms { "Native", "x64" } prepare() - premake.vs200x_vcproj_platforms(prj) + vc200x.Platforms(prj) test.capture [[ <Platforms> <Platform @@ -304,7 +304,7 @@ function suite.PlatformsList_OnXbox360() platforms { "Native", "Xbox360" } prepare() - premake.vs200x_vcproj_platforms(prj) + vc200x.Platforms(prj) test.capture [[ <Platforms> <Platform @@ -320,7 +320,7 @@ function suite.CompilerBlock_OnXbox360() platforms { "Xbox360" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug", "Xbox360")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug", "Xbox360")) test.capture [[ <Tool Name="VCCLX360CompilerTool" @@ -345,7 +345,7 @@ function suite.PlatformsList_OnPS3() platforms { "Native", "PS3" } prepare() - premake.vs200x_vcproj_platforms(prj) + vc200x.Platforms(prj) test.capture [[ <Platforms> <Platform @@ -361,7 +361,7 @@ includedirs { "include/pkg1", "include/pkg2" } defines { "DEFINE1", "DEFINE2" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) + vc200x.VCCLCompilerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -379,7 +379,7 @@ function suite.LinkerBlock_OnPS3ConsoleApp() platforms { "PS3" } prepare() - premake.vs200x_vcproj_VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) + vc200x.VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ <Tool Name="VCLinkerTool" @@ -399,7 +399,7 @@ platforms { "PS3" } kind "StaticLib" prepare() - premake.vs200x_vcproj_VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) + vc200x.VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ <Tool Name="VCLibrarianTool" @@ -416,7 +416,7 @@ language "C++" kind "SharedLib" prepare() - premake.vs200x_vcproj_VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) + vc200x.VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ <Tool @@ -442,7 +442,7 @@ function suite.VCManifestTool_OnNoManifests() files { "hello.c", "goodbye.c" } prepare() - premake.vs200x_vcproj_VCManifestTool(premake.getconfig(prj, "Debug")) + vc200x.VCManifestTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCManifestTool" @@ -454,7 +454,7 @@ function suite.VCManifestTool_OnNoManifests() files { "hello.c", "project1.manifest", "goodbye.c", "project2.manifest" } prepare() - premake.vs200x_vcproj_VCManifestTool(premake.getconfig(prj, "Debug")) + vc200x.VCManifestTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCManifestTool" @@ -472,7 +472,7 @@ pchheader "source/common.h" pchsource "source/common.cpp" prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -498,7 +498,7 @@ function suite.CompilerBlock_OnFpFast() flags { "FloatFast" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -519,7 +519,7 @@ function suite.CompilerBlock_OnFpStrict() flags { "FloatStrict" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -545,7 +545,7 @@ function suite.CompilerBlock_OnTargetName() targetname "foob" prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -570,7 +570,7 @@ function suite.CompilerBlock_OnNoMinimalRebuild() flags { "Symbols", "NoMinimalRebuild" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -595,7 +595,7 @@ function suite.CompilerBlock_RuntimeLibrary_IsDebug_OnSymbolsNoOptimize() flags { "Symbols" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -616,7 +616,7 @@ function suite.CompilerBlock_RuntimeLibrary_IsRelease_OnOptimize() flags { "Symbols", "Optimize" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -642,7 +642,7 @@ language "C" flags { "Symbols" } prepare() - premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) + vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCCLCompilerTool" @@ -665,7 +665,7 @@ function suite.noLinkIncrementalFlag_valueEqualsOne() flags { "NoIncrementalLink" } prepare() - premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) + vc200x.VCLinkerTool(premake.getconfig(prj, "Debug")) local result = io.endcapture() test.string_contains(result,'LinkIncremental="1"') end diff --git a/tests/actions/vstudio/test_vs200x_vcproj_linker.lua b/tests/actions/vstudio/test_vs200x_vcproj_linker.lua index 1ff5836..1b89579 100755 --- a/tests/actions/vstudio/test_vs200x_vcproj_linker.lua +++ b/tests/actions/vstudio/test_vs200x_vcproj_linker.lua @@ -1,12 +1,12 @@ -- -- tests/actions/vstudio/test_vs200x_vcproj_linker.lua -- Automated tests for Visual Studio 2002-2008 C/C++ linker block. --- Copyright (c) 2009, 2010 Jason Perkins and the Premake project +-- Copyright (c) 2009-2011 Jason Perkins and the Premake project -- T.vs200x_vcproj_linker = { } local suite = T.vs200x_vcproj_linker - local vcproj = premake.vstudio.vcproj + local vc200x = premake.vstudio.vc200x -- @@ -33,7 +33,7 @@ function suite.DefaultLinkerBlock_OnConsoleApp() kind "ConsoleApp" prepare() - premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) + vc200x.VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCLinkerTool" @@ -51,7 +51,7 @@ function suite.DefaultLinkerBlock_OnWindowedApp() kind "WindowedApp" prepare() - premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) + vc200x.VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCLinkerTool" @@ -69,7 +69,7 @@ function suite.DefaultLinkerBlock_OnSharedLib() kind "SharedLib" prepare() - premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) + vc200x.VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCLinkerTool" @@ -87,7 +87,7 @@ function suite.DefaultLinkerBlock_OnStaticLib() kind "StaticLib" prepare() - premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) + vc200x.VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCLibrarianTool" @@ -105,7 +105,7 @@ kind "StaticLib" linkoptions { "/ltcg", "/lZ" } prepare() - premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) + vc200x.VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ <Tool Name="VCLibrarianTool" diff --git a/tests/actions/vstudio/test_vs2010_filters.lua b/tests/actions/vstudio/test_vs2010_filters.lua index 0805114..18daf36 100644 --- a/tests/actions/vstudio/test_vs2010_filters.lua +++ b/tests/actions/vstudio/test_vs2010_filters.lua @@ -1,122 +1,122 @@ T.vs2010_filters = { }
local vs10_filters = T.vs2010_filters
- local vs10_helpers = premake.vstudio.vs10_helpers
+ local vc2010 = premake.vstudio.vc2010
local sln, prj
- function vs10_filters.setup() - _ACTION = "vs2010" - sln = solution "MySolution" - configurations { "Debug" } - platforms {} - - prj = project "MyProject" - language "C++" - kind "ConsoleApp" + function vs10_filters.setup()
+ _ACTION = "vs2010"
+ sln = solution "MySolution"
+ configurations { "Debug" }
+ platforms {}
+
+ prj = project "MyProject"
+ language "C++"
+ kind "ConsoleApp"
end
- local function get_buffer() - io.capture() - premake.buildconfigs() - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) - premake.vs2010_vcxproj_filters(prj) - buffer = io.endcapture() - return buffer + local function get_buffer()
+ io.capture()
+ premake.buildconfigs()
+ sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
+ premake.vs2010_vcxproj_filters(prj)
+ buffer = io.endcapture()
+ return buffer
end
function vs10_filters.path_noPath_returnsNil()
- local result = vs10_helpers.file_path("foo.h")
+ local result = vc2010.file_path("foo.h")
test.isequal(nil,result)
end
function vs10_filters.path_hasOneDirectoryPath_returnsIsFoo()
local path = "foo"
- local result = vs10_helpers.file_path(path .."\\foo.h")
+ local result = vc2010.file_path(path .."\\foo.h")
test.isequal(path,result)
end
function vs10_filters.path_hasTwoDirectoryPath_returnsIsFooSlashBar()
local path = "foo\\bar"
- local result = vs10_helpers.file_path(path .."\\foo.h")
+ local result = vc2010.file_path(path .."\\foo.h")
test.isequal(path,result)
end
function vs10_filters.path_hasTwoDirectoryPath_returnsIsFooSlashBar_Baz()
local path = "foo\\bar_baz"
- local result = vs10_helpers.file_path(path .."\\foo.h")
+ local result = vc2010.file_path(path .."\\foo.h")
test.isequal(path,result)
end
function vs10_filters.path_extensionWithHyphen_returnsIsFoo()
local path = "foo"
- local result = vs10_helpers.file_path(path .."\\foo-bar.h")
+ local result = vc2010.file_path(path .."\\foo-bar.h")
test.isequal(path,result)
end
function vs10_filters.path_extensionWithNumber_returnsIs2Foo()
local path = "foo"
- local result = vs10_helpers.file_path(path .."\\2foo.h")
+ local result = vc2010.file_path(path .."\\2foo.h")
test.isequal(path,result)
end
function vs10_filters.path_hasThreeDirectoryPath_returnsIsFooSlashBarSlashBaz()
local path = "foo\\bar\\baz"
- local result = vs10_helpers.file_path(path .."\\foo.h")
+ local result = vc2010.file_path(path .."\\foo.h")
test.isequal(path,result)
end
function vs10_filters.path_hasDotDotSlashDirectoryPath_returnsNil()
local path = ".."
- local result = vs10_helpers.file_path(path .."\\foo.h")
+ local result = vc2010.file_path(path .."\\foo.h")
test.isequal(nil,result)
end
function vs10_filters.removeRelativePath_noRelativePath_returnsInput()
local path = "foo.h"
- local result = vs10_helpers.remove_relative_path(path)
+ local result = vc2010.remove_relative_path(path)
test.isequal("foo.h",result)
end
function vs10_filters.removeRelativePath_dotDotSlashFoo_returnsFoo()
local path = "..\\foo"
- local result = vs10_helpers.remove_relative_path(path)
+ local result = vc2010.remove_relative_path(path)
test.isequal("foo",result)
end
function vs10_filters.removeRelativePath_dotDotSlashDotDotSlashFoo_returnsFoo()
local path = "..\\..\\foo"
- local result = vs10_helpers.remove_relative_path(path)
+ local result = vc2010.remove_relative_path(path)
test.isequal("foo",result)
end
function vs10_filters.removeRelativePath_DotSlashFoo_returnsFoo()
local path = ".\\foo"
- local result = vs10_helpers.remove_relative_path(path)
+ local result = vc2010.remove_relative_path(path)
test.isequal("foo",result)
end
function vs10_filters.listOfDirectories_oneDirectory_returnsSizeIsOne()
- local result = vs10_helpers.list_of_directories_in_path("foo\\bar.h")
+ local result = vc2010.list_of_directories_in_path("foo\\bar.h")
test.isequal(1,#result)
end
function vs10_filters.listOfDirectories_oneDirectory_returnsContainsFoo()
- local result = vs10_helpers.list_of_directories_in_path("foo\\bar.h")
+ local result = vc2010.list_of_directories_in_path("foo\\bar.h")
test.contains(result,"foo")
end
function vs10_filters.listOfDirectories_twoDirectories_returnsSizeIsTwo()
- local result = vs10_helpers.list_of_directories_in_path("foo\\bar\\bar.h")
+ local result = vc2010.list_of_directories_in_path("foo\\bar\\bar.h")
test.isequal(2,#result)
end
function vs10_filters.listOfDirectories_twoDirectories_secondEntryIsFooSlashBar()
- local result = vs10_helpers.list_of_directories_in_path("foo\\bar\\bar.h")
+ local result = vc2010.list_of_directories_in_path("foo\\bar\\bar.h")
test.isequal("foo\\bar",result[2])
end
function vs10_filters.listOfDirectories_dotSlash_returnsIsEmpty()
- local result = vs10_helpers.list_of_directories_in_path(".\\bar.h")
+ local result = vc2010.list_of_directories_in_path(".\\bar.h")
test.isequal(0,#result)
end
@@ -127,7 +127,7 @@ bar = {'foo\\bar.h'},
baz = {'baz\\bar.h'}
}
- local result = vs10_helpers.table_of_file_filters(t)
+ local result = vc2010.table_of_file_filters(t)
test.isequal(2,#result)
end
@@ -138,7 +138,7 @@ bar = {'foo\\bar.h'},
baz = {'baz\\bar.h'}
}
- local result = vs10_helpers.table_of_file_filters(t)
+ local result = vc2010.table_of_file_filters(t)
--order is not defined
test.contains(result,'foo')
end
@@ -150,7 +150,7 @@ bar = {'foo\\bar.h'},
baz = {'baz\\bar.h'}
}
- local result = vs10_helpers.table_of_file_filters(t)
+ local result = vc2010.table_of_file_filters(t)
--order is not defined
test.contains(result,'baz')
end
@@ -163,7 +163,7 @@ baz = {'bar\\bar.h'},
bazz = {'bar\\foo\\bar.h'}
}
- local result = vs10_helpers.table_of_file_filters(t)
+ local result = vc2010.table_of_file_filters(t)
--order is not defined
test.isequal(4,#result)
end
@@ -173,7 +173,7 @@ {
foo = {'foo\\bar.h','foo\\bar\\bar.h'}
}
- local result = vs10_helpers.table_of_file_filters(t)
+ local result = vc2010.table_of_file_filters(t)
--order is not defined
test.isequal(2,#result)
end
@@ -266,7 +266,7 @@ {
foo = {'src\\host\\lua-5.1.4\\foo.h'}
}
- local result = vs10_helpers.table_of_file_filters(t)
+ local result = vc2010.table_of_file_filters(t)
test.isequal(3,#result)
end
@@ -275,12 +275,12 @@ {
foo = {'src\\host\\lua-5.1.4\\foo.h'}
}
- local result = vs10_helpers.table_of_file_filters(t)
+ local result = vc2010.table_of_file_filters(t)
test.contains(result,'src\\host\\lua-5.1.4')
end
function vs10_filters.listOfDirectories_filterContainsDots_resultContainsTheEntry()
- local result = vs10_helpers.list_of_directories_in_path('src\\host\\lua.4\\foo.h')
+ local result = vc2010.list_of_directories_in_path('src\\host\\lua.4\\foo.h')
test.contains(result,'src\\host\\lua.4')
end
diff --git a/tests/actions/vstudio/test_vs2010_flags.lua b/tests/actions/vstudio/test_vs2010_flags.lua index c1a7b56..b4201f4 100644 --- a/tests/actions/vstudio/test_vs2010_flags.lua +++ b/tests/actions/vstudio/test_vs2010_flags.lua @@ -1,6 +1,6 @@ -
-T.vs2010_flags = { }
-local vs10_flags = T.vs2010_flags
+ +T.vs2010_flags = { } +local vs10_flags = T.vs2010_flags local sln, prj function vs10_flags.setup() @@ -20,7 +20,7 @@ end local function get_buffer() io.capture() premake.buildconfigs() - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) premake.vs2010_vcxproj(prj) local buffer = io.endcapture() return buffer @@ -34,7 +34,7 @@ function vs10_flags.sseSet() test.string_contains(buffer,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>') end -function vs10_flags.sse2Set()
+function vs10_flags.sse2Set() flags {"EnableSSE2"} local buffer = get_buffer() @@ -129,40 +129,40 @@ function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed() local buffer = get_buffer() test.string_contains(buffer,'<Optimization>MaxSpeed</Optimization>') -end
+end function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed() flags {"Optimize"} local buffer = get_buffer() test.string_contains(buffer,'<Optimization>Full</Optimization>') end -
-
-local debug_string = "Symbols"
+ + +local debug_string = "Symbols" local release_string = "Optimize" -function vs10_flags.debugHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDebugDLL()
- flags {debug_string}
- local buffer = get_buffer()
- test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>')
-end
-
-function vs10_flags.debugAndStaticRuntime_runtimeLibrary_setToMultiThreadedDebug()
- flags {debug_string,"StaticRuntime"}
- local buffer = get_buffer()
- test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>')
-end
-
-function vs10_flags.releaseHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDLL()
- flags {release_string}
- local buffer = get_buffer()
- test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>')
-end
-
-function vs10_flags.releaseAndStaticRuntime_runtimeLibrary_setToMultiThreaded()
- flags {release_string,"StaticRuntime"}
- local buffer = get_buffer()
- test.string_contains(buffer,'<RuntimeLibrary>MultiThreaded</RuntimeLibrary>')
-end
+function vs10_flags.debugHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDebugDLL() + flags {debug_string} + local buffer = get_buffer() + test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>') +end + +function vs10_flags.debugAndStaticRuntime_runtimeLibrary_setToMultiThreadedDebug() + flags {debug_string,"StaticRuntime"} + local buffer = get_buffer() + test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>') +end + +function vs10_flags.releaseHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDLL() + flags {release_string} + local buffer = get_buffer() + test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>') +end + +function vs10_flags.releaseAndStaticRuntime_runtimeLibrary_setToMultiThreaded() + flags {release_string,"StaticRuntime"} + local buffer = get_buffer() + test.string_contains(buffer,'<RuntimeLibrary>MultiThreaded</RuntimeLibrary>') +end function vs10_flags.noCharacterSetDefine_characterSet_setToMultiByte() local buffer = get_buffer() @@ -191,75 +191,75 @@ function vs10_flags.debugYetNotMinimalRebuild_minimalRebuild_setToTrue() local buffer = get_buffer() test.string_contains(buffer,'<MinimalRebuild>true</MinimalRebuild>') end -
-function vs10_flags.release_minimalRebuild_setToFalse()
- flags {release_string}
-
- local buffer = get_buffer()
- test.string_contains(buffer,'<MinimalRebuild>false</MinimalRebuild>')
-end
-
-function vs10_flags.mfc_useOfMfc_setToStatic()
- flags{"MFC"}
-
- local buffer = get_buffer()
- test.string_contains(buffer,'<UseOfMfc>Dynamic</UseOfMfc>')
-end
-
-function vs10_flags.Symbols_DebugInformationFormat_setToEditAndContinue()
- flags{"Symbols"}
-
- local buffer = get_buffer()
- test.string_contains(buffer,'<DebugInformationFormat>EditAndContinue</DebugInformationFormat>')
-end
-
-function vs10_flags.symbolsAndNoEditAndContinue_DebugInformationFormat_setToProgramDatabase()
- flags{"Symbols","NoEditAndContinue"}
-
- local buffer = get_buffer()
- test.string_contains(buffer,'<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>')
-end
-
-function vs10_flags.symbolsAndRelease_DebugInformationFormat_setToProgramDatabase()
- flags{"Symbols",release_string}
-
- local buffer = get_buffer()
- test.string_contains(buffer,'<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>')
-end
-function vs10_flags.noSymbols_DebugInformationFormat_blockIsEmpty()
- local buffer = get_buffer()
- test.string_contains(buffer,'<DebugInformationFormat></DebugInformationFormat>')
-end
-
-function vs10_flags.symbols_64BitBuild_DebugInformationFormat_setToOldStyle()
- flags{"Symbols"}
- platforms{"x64"}
- local buffer = get_buffer()
- test.string_contains(buffer,'<DebugInformationFormat>OldStyle</DebugInformationFormat>')
-end
-
-function vs10_flags.noManifest_GenerateManifest_setToFalse()
- flags{"NoManifest"}
-
- local buffer = get_buffer()
- test.string_contains(buffer,'<GenerateManifest Condition="\'%$%(Configuration%)|%$%(Platform%)\'==\'Debug|Win32\'">false</GenerateManifest>')
-end
-
-function vs10_flags.noSymbols_bufferDoesNotContainprogramDataBaseFile()
- local buffer = get_buffer()
- test.string_does_not_contain(buffer,'<Link>.*<ProgramDataBaseFileName>.*</Link>')
-end
-function vs10_flags.symbols_bufferContainsprogramDataBaseFile()
- flags{"Symbols"}
- local buffer = get_buffer()
- test.string_contains(buffer,'<Link>.*<ProgramDataBaseFileName>%$%(OutDir%)MyProject%.pdb</ProgramDataBaseFileName>.*</Link>')
-end -
-function vs10_flags.noIncrementalLink_linkIncrementSetToFalse()
- flags{"NoIncrementalLink"}
- local buffer = get_buffer()
- test.string_contains(buffer,'<LinkIncremental.*false</LinkIncremental>')
-end
+ +function vs10_flags.release_minimalRebuild_setToFalse() + flags {release_string} + + local buffer = get_buffer() + test.string_contains(buffer,'<MinimalRebuild>false</MinimalRebuild>') +end + +function vs10_flags.mfc_useOfMfc_setToStatic() + flags{"MFC"} + + local buffer = get_buffer() + test.string_contains(buffer,'<UseOfMfc>Dynamic</UseOfMfc>') +end + +function vs10_flags.Symbols_DebugInformationFormat_setToEditAndContinue() + flags{"Symbols"} + + local buffer = get_buffer() + test.string_contains(buffer,'<DebugInformationFormat>EditAndContinue</DebugInformationFormat>') +end + +function vs10_flags.symbolsAndNoEditAndContinue_DebugInformationFormat_setToProgramDatabase() + flags{"Symbols","NoEditAndContinue"} + + local buffer = get_buffer() + test.string_contains(buffer,'<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>') +end + +function vs10_flags.symbolsAndRelease_DebugInformationFormat_setToProgramDatabase() + flags{"Symbols",release_string} + + local buffer = get_buffer() + test.string_contains(buffer,'<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>') +end +function vs10_flags.noSymbols_DebugInformationFormat_blockIsEmpty() + local buffer = get_buffer() + test.string_contains(buffer,'<DebugInformationFormat></DebugInformationFormat>') +end + +function vs10_flags.symbols_64BitBuild_DebugInformationFormat_setToOldStyle() + flags{"Symbols"} + platforms{"x64"} + local buffer = get_buffer() + test.string_contains(buffer,'<DebugInformationFormat>OldStyle</DebugInformationFormat>') +end + +function vs10_flags.noManifest_GenerateManifest_setToFalse() + flags{"NoManifest"} + + local buffer = get_buffer() + test.string_contains(buffer,'<GenerateManifest Condition="\'%$%(Configuration%)|%$%(Platform%)\'==\'Debug|Win32\'">false</GenerateManifest>') +end + +function vs10_flags.noSymbols_bufferDoesNotContainprogramDataBaseFile() + local buffer = get_buffer() + test.string_does_not_contain(buffer,'<Link>.*<ProgramDataBaseFileName>.*</Link>') +end +function vs10_flags.symbols_bufferContainsprogramDataBaseFile() + flags{"Symbols"} + local buffer = get_buffer() + test.string_contains(buffer,'<Link>.*<ProgramDataBaseFileName>%$%(OutDir%)MyProject%.pdb</ProgramDataBaseFileName>.*</Link>') +end + +function vs10_flags.noIncrementalLink_linkIncrementSetToFalse() + flags{"NoIncrementalLink"} + local buffer = get_buffer() + test.string_contains(buffer,'<LinkIncremental.*false</LinkIncremental>') +end diff --git a/tests/actions/vstudio/test_vs2010_links.lua b/tests/actions/vstudio/test_vs2010_links.lua index 0d6b128..5b03606 100644 --- a/tests/actions/vstudio/test_vs2010_links.lua +++ b/tests/actions/vstudio/test_vs2010_links.lua @@ -3,25 +3,25 @@ local sln, prj
function vs10_links.setup()
- _ACTION = "vs2010" - - sln = solution "MySolution" - configurations { "Debug" } - platforms {} - - prj = project "MyProject" - language "C++" - kind "ConsoleApp" + _ACTION = "vs2010"
+
+ sln = solution "MySolution"
+ configurations { "Debug" }
+ platforms {}
+
+ prj = project "MyProject"
+ language "C++"
+ kind "ConsoleApp"
uuid "AE61726D-187C-E440-BD07-2556188A6565"
- end - - local function get_buffer() - io.capture() - premake.buildconfigs() - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) - premake.vs2010_vcxproj(prj) - buffer = io.endcapture() - return buffer + end
+
+ local function get_buffer()
+ io.capture()
+ premake.buildconfigs()
+ sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
+ premake.vs2010_vcxproj(prj)
+ buffer = io.endcapture()
+ return buffer
end
function vs10_links.hasLinkBlock()
diff --git a/tests/actions/vstudio/test_vs2010_project_kinds.lua b/tests/actions/vstudio/test_vs2010_project_kinds.lua index e2bc1a6..ea719b8 100644 --- a/tests/actions/vstudio/test_vs2010_project_kinds.lua +++ b/tests/actions/vstudio/test_vs2010_project_kinds.lua @@ -3,23 +3,23 @@ local sln, prj
function vs10_project_kinds.setup()
- _ACTION = "vs2010" - - sln = solution "MySolution" - configurations { "Debug" } - platforms {} - - prj = project "MyProject" + _ACTION = "vs2010"
+
+ sln = solution "MySolution"
+ configurations { "Debug" }
+ platforms {}
+
+ prj = project "MyProject"
language "C++"
- end - - local function get_buffer() - io.capture() - premake.buildconfigs() - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) - premake.vs2010_vcxproj(prj) - buffer = io.endcapture() - return buffer + end
+
+ local function get_buffer()
+ io.capture()
+ premake.buildconfigs()
+ sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
+ premake.vs2010_vcxproj(prj)
+ buffer = io.endcapture()
+ return buffer
end
@@ -139,7 +139,7 @@ shared lib missing <ImportLibrary>???</ImportLibrary> in link section when noIn function vs10_project_kinds.configType_configIsWindowedApp_resultComparesEqualToApplication()
local t = { kind = "WindowedApp"}
- local result = premake.vstudio.vs10_helpers.config_type(t)
+ local result = premake.vstudio.vc2010.config_type(t)
test.isequal('Application',result)
end
diff --git a/tests/actions/vstudio/test_vs2010_vcxproj.lua b/tests/actions/vstudio/test_vs2010_vcxproj.lua index 039000a..7dafc82 100644 --- a/tests/actions/vstudio/test_vs2010_vcxproj.lua +++ b/tests/actions/vstudio/test_vs2010_vcxproj.lua @@ -3,7 +3,7 @@ local include_directory = "bar/foo" local include_directory2 = "baz/foo" local debug_define = "I_AM_ALIVE_NUMBER_FIVE" - local vs10_helpers = premake.vstudio.vs10_helpers + local vc2010 = premake.vstudio.vc2010 local sln, prj function vs10_vcxproj.teardown() @@ -49,7 +49,7 @@ local function get_buffer() io.capture() premake.buildconfigs() - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) premake.vs2010_vcxproj(prj) local buffer = io.endcapture() return buffer @@ -197,32 +197,32 @@ end function vs10_vcxproj.fileExtension_extEqualH() - local ext = vs10_helpers.get_file_extension('foo.h') + local ext = vc2010.get_file_extension('foo.h') test.isequal('h', ext) end function vs10_vcxproj.fileExtension_containsTwoDots_extEqualH() - local ext = vs10_helpers.get_file_extension('foo.bar.h') + local ext = vc2010.get_file_extension('foo.bar.h') test.isequal('h', ext) end function vs10_vcxproj.fileExtension_alphaNumeric_extEqualOneH() - local ext = vs10_helpers.get_file_extension('foo.1h') + local ext = vc2010.get_file_extension('foo.1h') test.isequal('1h', ext) end function vs10_vcxproj.fileExtension_alphaNumericWithUnderscore_extEqualOne_H() - local ext = vs10_helpers.get_file_extension('foo.1_h') + local ext = vc2010.get_file_extension('foo.1_h') test.isequal('1_h', ext) end function vs10_vcxproj.fileExtension_containsHyphen_extEqualHHyphenH() - local ext = vs10_helpers.get_file_extension('foo.h-h') + local ext = vc2010.get_file_extension('foo.h-h') test.isequal('h-h', ext) end function vs10_vcxproj.fileExtension_containsMoreThanOneDot_extEqualOneH() - local ext = vs10_helpers.get_file_extension('foo.bar.h') + local ext = vc2010.get_file_extension('foo.bar.h') test.isequal('h', ext) end @@ -234,7 +234,7 @@ None ={}, ResourceCompile ={} } - vs10_helpers.sort_input_files(input,sorted) + vc2010.sort_input_files(input,sorted) return sorted end function vs10_vcxproj.sortFile_headerFile_SortedClIncludeEqualToFile() diff --git a/tests/actions/vstudio/vs200x/files.lua b/tests/actions/vstudio/vs200x/files.lua index d8a1201..64bc06b 100644 --- a/tests/actions/vstudio/vs200x/files.lua +++ b/tests/actions/vstudio/vs200x/files.lua @@ -6,7 +6,7 @@ T.vstudio_200x_files = { } local suite = T.vstudio_200x_files - local vcproj = premake.vstudio.vcproj + local vc200x = premake.vstudio.vc200x -- @@ -23,8 +23,8 @@ io.capture() premake.buildconfigs() prj = premake.solution.getproject(sln, 1) - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) - vcproj.Files(prj) + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) + vc200x.Files(prj) end diff --git a/tests/test_vs2002_sln.lua b/tests/test_vs2002_sln.lua index 623b724..470c3cc 100644 --- a/tests/test_vs2002_sln.lua +++ b/tests/test_vs2002_sln.lua @@ -5,13 +5,15 @@ -- T.vs2002_sln = { } + local suite = T.vs2002_sln + local sln2002 = premake.vstudio.sln2002 -- -- Configure a solution for testing -- local sln - function T.vs2002_sln.setup() + function suite.setup() _ACTION = 'vs2002' sln = solution "MySolution" @@ -32,9 +34,9 @@ -- Make sure I've got the basic layout correct -- - function T.vs2002_sln.BasicLayout() + function suite.BasicLayout() io.capture() - premake.vs2002_solution(sln) + sln2002.generate(sln) test.capture [[ Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" diff --git a/tests/test_vs2003_sln.lua b/tests/test_vs2003_sln.lua index 42e0aee..23a9e26 100644 --- a/tests/test_vs2003_sln.lua +++ b/tests/test_vs2003_sln.lua @@ -5,13 +5,15 @@ -- T.vs2003_sln = { } + local suite = T.vs2003_sln + local sln2003 = premake.vstudio.sln2003 -- -- Configure a solution for testing -- local sln - function T.vs2003_sln.setup() + function suite.setup() _ACTION = "vs2003" sln = solution "MySolution" @@ -32,9 +34,9 @@ -- Make sure I've got the basic layout correct -- - function T.vs2003_sln.BasicLayout() + function suite.BasicLayout() io.capture() - premake.vs2003_solution(sln) + sln2003.generate(sln) test.capture [[ Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" diff --git a/tests/test_vs2005_sln.lua b/tests/test_vs2005_sln.lua index a402ed2..3fdeac4 100644 --- a/tests/test_vs2005_sln.lua +++ b/tests/test_vs2005_sln.lua @@ -5,13 +5,15 @@ -- T.vs2005_sln = { } + local suite = T.vs2005_sln + local sln2005 = premake.vstudio.sln2005 -- -- Configure a solution for testing -- local sln - function T.vs2005_sln.setup() + function suite.setup() sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} @@ -27,7 +29,7 @@ local function prepare() io.capture() premake.buildconfigs() - sln.vstudio_configs = premake.vstudio_buildconfigs(sln) + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) end local function addnetproject() @@ -44,9 +46,9 @@ -- Make sure I've got the basic layout correct -- - function T.vs2005_sln.BasicLayout() + function suite.BasicLayout() prepare() - premake.vs2005_solution(sln) + sln2005.generate(sln) test.capture ('\239\187\191' .. [[ Microsoft Visual Studio Solution File, Format Version 9.00 @@ -77,11 +79,11 @@ EndGlobal -- Test a mixed runtime (C++/.NET) solution. -- - function T.vs2005_sln.SolutionPlatforms_OnMixedModes() + function suite.SolutionPlatforms_OnMixedModes() addnetproject() prepare() - premake.vs2005_solution_platforms(sln) + sln2005.platforms(sln) test.capture [[ GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -95,11 +97,11 @@ EndGlobal end - function T.vs2005_sln.ProjectPlatforms_OnMixedModes() + function suite.ProjectPlatforms_OnMixedModes() addnetproject() prepare() - premake.vs2005_solution_project_platforms(sln) + sln2005.project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32 @@ -132,11 +134,11 @@ EndGlobal -- Test multiple platforms -- - function T.vs2005_sln.SolutionPlatforms_OnMultiplePlatforms() + function suite.SolutionPlatforms_OnMultiplePlatforms() platforms { "x32", "x64" } prepare() - premake.vs2005_solution_platforms(sln) + sln2005.platforms(sln) test.capture [[ GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -148,11 +150,11 @@ EndGlobal end - function T.vs2005_sln.ProjectPlatforms_OnMultiplePlatforms() + function suite.ProjectPlatforms_OnMultiplePlatforms() platforms { "x32", "x64" } prepare() - premake.vs2005_solution_project_platforms(sln) + sln2005.project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -168,12 +170,12 @@ EndGlobal end - function T.vs2005_sln.ProjectPlatforms_OnMultiplePlatformsAndMixedModes() + function suite.ProjectPlatforms_OnMultiplePlatformsAndMixedModes() platforms { "x32", "x64" } addnetproject() prepare() - premake.vs2005_solution_project_platforms(sln) + sln2005.project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32 @@ -211,11 +213,11 @@ EndGlobal -- Test PS3 support -- - function T.vs2005_sln.SolutionPlatforms_OnPS3() + function suite.SolutionPlatforms_OnPS3() platforms { "PS3" } prepare() - premake.vs2005_solution_platforms(sln) + sln2005.platforms(sln) test.capture [[ GlobalSection(SolutionConfigurationPlatforms) = preSolution PS3 Debug|Win32 = PS3 Debug|Win32 @@ -225,11 +227,11 @@ EndGlobal end - function T.vs2005_sln.ProjectPlatforms_OnPS3() + function suite.ProjectPlatforms_OnPS3() platforms { "PS3" } prepare() - premake.vs2005_solution_project_platforms(sln) + sln2005.project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.PS3 Debug|Win32.ActiveCfg = PS3 Debug|Win32 diff --git a/tests/test_vs2008_sln.lua b/tests/test_vs2008_sln.lua index 8eec33e..e615b80 100644 --- a/tests/test_vs2008_sln.lua +++ b/tests/test_vs2008_sln.lua @@ -5,13 +5,15 @@ -- T.vs2008_sln = { } + local suite = T.vs2008_sln + local sln2005 = premake.vstudio.sln2005 -- -- Configure a solution for testing -- local sln - function T.vs2008_sln.setup() + function suite.setup() _ACTION = "vs2008" sln = solution "MySolution" @@ -32,9 +34,9 @@ -- Make sure I've got the basic layout correct -- - function T.vs2008_sln.BasicLayout() + function suite.BasicLayout() io.capture() - premake.vs2005_solution(sln) + sln2005.generate(sln) test.capture ('\239\187\191' .. [[ Microsoft Visual Studio Solution File, Format Version 10.00 |