diff --git a/modules/d/actions/vstudio.lua b/modules/d/actions/vstudio.lua
index e2746ee6..b7d1ea2d 100644
--- a/modules/d/actions/vstudio.lua
+++ b/modules/d/actions/vstudio.lua
@@ -9,6 +9,8 @@
m.visuald = {}
+ require ("vstudio")
+
local vstudio = p.vstudio
local workspace = p.workspace
local project = p.project
diff --git a/modules/vstudio/_manifest.lua b/modules/vstudio/_manifest.lua
new file mode 100644
index 00000000..1cc7b193
--- /dev/null
+++ b/modules/vstudio/_manifest.lua
@@ -0,0 +1,23 @@
+return {
+ "_preload.lua",
+ "vstudio.lua",
+ "vs2005.lua",
+ "vs2008.lua",
+ "vs200x_vcproj.lua",
+ "vs200x_vcproj_user.lua",
+ "vs2005_solution.lua",
+ "vs2005_csproj.lua",
+ "vs2005_csproj_user.lua",
+ "vs2010.lua",
+ "vs2010_nuget.lua",
+ "vs2010_vcxproj.lua",
+ "vs2010_vcxproj_user.lua",
+ "vs2010_vcxproj_filters.lua",
+ "vs2010_rules_props.lua",
+ "vs2010_rules_targets.lua",
+ "vs2010_rules_xml.lua",
+ "vs2012.lua",
+ "vs2013.lua",
+ "vs2015.lua",
+ "vs2017.lua",
+}
diff --git a/modules/vstudio/_preload.lua b/modules/vstudio/_preload.lua
new file mode 100644
index 00000000..3e75e020
--- /dev/null
+++ b/modules/vstudio/_preload.lua
@@ -0,0 +1,37 @@
+--
+-- _preload.lua
+-- Define the makefile action(s).
+-- Copyright (c) 2002-2015 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local project = p.project
+
+ -- initialize module.
+ p.modules.vstudio = p.modules.vstudio or {}
+ p.modules.vstudio._VERSION = p._VERSION
+ p.vstudio = p.modules.vstudio
+
+ -- load actions.
+ include("vs2005.lua")
+ include("vs2008.lua")
+ include("vs2010.lua")
+ include("vs2012.lua")
+ include("vs2013.lua")
+ include("vs2015.lua")
+ include("vs2017.lua")
+
+--
+-- Decide when the full module should be loaded.
+--
+
+ return function(cfg)
+ return
+ _ACTION == "vs2005" or
+ _ACTION == "vs2008" or
+ _ACTION == "vs2010" or
+ _ACTION == "vs2012" or
+ _ACTION == "vs2013" or
+ _ACTION == "vs2015" or
+ _ACTION == "vs2017";
+ end
diff --git a/modules/vstudio/tests/_tests.lua b/modules/vstudio/tests/_tests.lua
new file mode 100644
index 00000000..01b7654e
--- /dev/null
+++ b/modules/vstudio/tests/_tests.lua
@@ -0,0 +1,86 @@
+require ("vstudio")
+
+return {
+ -- Visual Studio 2005-2013 C# projects
+ "cs2005/test_assembly_refs.lua",
+ "cs2005/test_build_events.lua",
+ "cs2005/test_common_props.lua",
+ "cs2005/test_compiler_props.lua",
+ "cs2005/test_debug_props.lua",
+ "cs2005/test_files.lua",
+ "cs2005/test_icon.lua",
+ "cs2005/test_nuget_config.lua",
+ "cs2005/test_nuget_packages_config.lua",
+ "cs2005/test_output_props.lua",
+ "cs2005/projectelement.lua",
+ "cs2005/test_platform_groups.lua",
+ "cs2005/test_project_refs.lua",
+ "cs2005/projectsettings.lua",
+ "cs2005/test_targets.lua",
+ "cs2005/test_user_file.lua",
+
+ -- Visual Studio 2005-2013 solutions
+ "sln2005/test_dependencies.lua",
+ "sln2005/test_header.lua",
+ "sln2005/test_nested_projects.lua",
+ "sln2005/test_projects.lua",
+ "sln2005/test_platforms.lua",
+ "sln2005/test_sections.lua",
+
+ -- Visual Studio 2002-2008 C/C++ projects
+ "vc200x/test_assembly_refs.lua",
+ "vc200x/test_build_steps.lua",
+ "vc200x/test_configuration.lua",
+ "vc200x/test_compiler_block.lua",
+ "vc200x/test_debug_settings.lua",
+ "vc200x/test_excluded_configs.lua",
+ "vc200x/test_files.lua",
+ "vc200x/test_linker_block.lua",
+ "vc200x/test_manifest_block.lua",
+ "vc200x/test_nmake_settings.lua",
+ "vc200x/test_platforms.lua",
+ "vc200x/test_project.lua",
+ "vc200x/test_project_refs.lua",
+ "vc200x/test_resource_compiler.lua",
+ "vc200x/test_user_file.lua",
+
+ -- Visual Studio 2010-2013 C/C++ projects
+ "vc2010/test_assembly_refs.lua",
+ "vc2010/test_build_events.lua",
+ "vc2010/test_build_log.lua",
+ "vc2010/test_character_set.lua",
+ "vc2010/test_compile_settings.lua",
+ "vc2010/test_config_props.lua",
+ "vc2010/test_debug_settings.lua",
+ "vc2010/test_excluded_configs.lua",
+ "vc2010/test_extension_settings.lua",
+ "vc2010/test_extension_targets.lua",
+ "vc2010/test_language_settings.lua",
+ "vc2010/test_language_targets.lua",
+ "vc2010/test_floatingpoint.lua",
+ "vc2010/test_globals.lua",
+ "vc2010/test_header.lua",
+ "vc2010/test_files.lua",
+ "vc2010/test_filter_ids.lua",
+ "vc2010/test_filters.lua",
+ "vc2010/test_imagexex_settings.lua",
+ "vc2010/test_item_def_group.lua",
+ "vc2010/test_link.lua",
+ "vc2010/test_manifest.lua",
+ "vc2010/test_nmake_props.lua",
+ "vc2010/test_nuget_packages_config.lua",
+ "vc2010/test_output_props.lua",
+ "vc2010/test_platform_toolset.lua",
+ "vc2010/test_project_configs.lua",
+ "vc2010/test_project_refs.lua",
+ "vc2010/test_prop_sheet.lua",
+ "vc2010/test_resource_compile.lua",
+ "vc2010/test_rule_props.lua",
+ "vc2010/test_rule_targets.lua",
+ "vc2010/test_rule_vars.lua",
+ "vc2010/test_rule_xml.lua",
+ "vc2010/test_target_machine.lua",
+ "vc2010/test_user_file.lua",
+ "vc2010/test_vectorextensions.lua",
+ "vc2010/test_ensure_nuget_imports.lua",
+}
diff --git a/tests/actions/vstudio/cs2005/projectelement.lua b/modules/vstudio/tests/cs2005/projectelement.lua
old mode 100755
new mode 100644
similarity index 100%
rename from tests/actions/vstudio/cs2005/projectelement.lua
rename to modules/vstudio/tests/cs2005/projectelement.lua
diff --git a/tests/actions/vstudio/cs2005/projectsettings.lua b/modules/vstudio/tests/cs2005/projectsettings.lua
old mode 100755
new mode 100644
similarity index 96%
rename from tests/actions/vstudio/cs2005/projectsettings.lua
rename to modules/vstudio/tests/cs2005/projectsettings.lua
index 25a4397b..a8f597f5
--- a/tests/actions/vstudio/cs2005/projectsettings.lua
+++ b/modules/vstudio/tests/cs2005/projectsettings.lua
@@ -1,207 +1,207 @@
---
--- tests/actions/vstudio/cs2005/projectsettings.lua
--- Validate generation of root in Visual Studio 2005+ .csproj
--- Copyright (c) 2009-2015 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vstudio_cs2005_projectsettings")
- local cs2005 = p.vstudio.cs2005
-
-
---
--- Setup
---
-
- local wks, prj
-
- function suite.setup()
- p.action.set("vs2005")
- wks = test.createWorkspace()
- language "C#"
- uuid "AE61726D-187C-E440-BD07-2556188A6565"
- end
-
- local function prepare()
- prj = test.getproject(wks, 1)
- cs2005.projectProperties(prj)
- end
-
-
---
--- Version Tests
---
-
- function suite.OnVs2005()
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyProject
- MyProject
-
- ]]
- end
-
-
- function suite.OnVs2008()
- p.action.set("vs2008")
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- 9.0.30729
- 2.0
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyProject
- MyProject
-
- ]]
- end
-
-
- function suite.OnVs2010()
- p.action.set("vs2010")
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyProject
- MyProject
- v4.0
-
-
- 512
-
- ]]
- end
-
-
- function suite.onVs2012()
- p.action.set("vs2012")
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyProject
- MyProject
- v4.5
- 512
-
- ]]
- end
-
-
---
--- Framework Tests
---
-
- function suite.OnFrameworkVersion()
- framework "3.0"
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyProject
- MyProject
- v3.0
-
- ]]
- end
-
-
- function suite.OnDotNetFrameworkVersion()
- dotnetframework "3.0"
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyProject
- MyProject
- v3.0
-
- ]]
- end
-
-
---
--- Make sure the root namespace can be overridden.
---
-
- function suite.canOverrideRootNamespace()
- namespace "MyCompany.%{prj.name}"
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyCompany.MyProject
- MyProject
-
- ]]
- end
-
-
---
--- WPF adds an additional element.
---
-
- function suite.projectTypeGuids_onWPF()
- p.action.set("vs2010")
- flags { "WPF" }
- prepare()
- test.capture [[
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {AE61726D-187C-E440-BD07-2556188A6565}
- Exe
- Properties
- MyProject
- MyProject
- v4.0
-
-
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
-
- ]]
- end
+--
+-- tests/actions/vstudio/cs2005/projectsettings.lua
+-- Validate generation of root in Visual Studio 2005+ .csproj
+-- Copyright (c) 2009-2015 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vstudio_cs2005_projectsettings")
+ local cs2005 = p.vstudio.cs2005
+
+
+--
+-- Setup
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2005")
+ wks = test.createWorkspace()
+ language "C#"
+ uuid "AE61726D-187C-E440-BD07-2556188A6565"
+ end
+
+ local function prepare()
+ prj = test.getproject(wks, 1)
+ cs2005.projectProperties(prj)
+ end
+
+
+--
+-- Version Tests
+--
+
+ function suite.OnVs2005()
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyProject
+ MyProject
+
+ ]]
+ end
+
+
+ function suite.OnVs2008()
+ p.action.set("vs2008")
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyProject
+ MyProject
+
+ ]]
+ end
+
+
+ function suite.OnVs2010()
+ p.action.set("vs2010")
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyProject
+ MyProject
+ v4.0
+
+
+ 512
+
+ ]]
+ end
+
+
+ function suite.onVs2012()
+ p.action.set("vs2012")
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyProject
+ MyProject
+ v4.5
+ 512
+
+ ]]
+ end
+
+
+--
+-- Framework Tests
+--
+
+ function suite.OnFrameworkVersion()
+ framework "3.0"
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyProject
+ MyProject
+ v3.0
+
+ ]]
+ end
+
+
+ function suite.OnDotNetFrameworkVersion()
+ dotnetframework "3.0"
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyProject
+ MyProject
+ v3.0
+
+ ]]
+ end
+
+
+--
+-- Make sure the root namespace can be overridden.
+--
+
+ function suite.canOverrideRootNamespace()
+ namespace "MyCompany.%{prj.name}"
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyCompany.MyProject
+ MyProject
+
+ ]]
+ end
+
+
+--
+-- WPF adds an additional element.
+--
+
+ function suite.projectTypeGuids_onWPF()
+ p.action.set("vs2010")
+ flags { "WPF" }
+ prepare()
+ test.capture [[
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {AE61726D-187C-E440-BD07-2556188A6565}
+ Exe
+ Properties
+ MyProject
+ MyProject
+ v4.0
+
+
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+
+ ]]
+ end
diff --git a/tests/actions/vstudio/cs2005/test_assembly_refs.lua b/modules/vstudio/tests/cs2005/test_assembly_refs.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_assembly_refs.lua
rename to modules/vstudio/tests/cs2005/test_assembly_refs.lua
diff --git a/tests/actions/vstudio/cs2005/test_build_events.lua b/modules/vstudio/tests/cs2005/test_build_events.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_build_events.lua
rename to modules/vstudio/tests/cs2005/test_build_events.lua
diff --git a/tests/actions/vstudio/cs2005/test_common_props.lua b/modules/vstudio/tests/cs2005/test_common_props.lua
similarity index 95%
rename from tests/actions/vstudio/cs2005/test_common_props.lua
rename to modules/vstudio/tests/cs2005/test_common_props.lua
index 1c5d9751..4cbf2c37 100644
--- a/tests/actions/vstudio/cs2005/test_common_props.lua
+++ b/modules/vstudio/tests/cs2005/test_common_props.lua
@@ -1,39 +1,39 @@
---
--- tests/actions/vstudio/cs2005/test_common_props.lua
--- Check Visual Studio 2012 extensions to the project properties block.
--- Copyright (c) 2013 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vs2012_csproj_common_props")
- local cs2005 = p.vstudio.cs2005
-
-
---
--- Setup
---
-
- local wks, prj
-
- function suite.setup()
- p.action.set("vs2012")
- wks = test.createWorkspace()
- language "C#"
- end
-
- local function prepare()
- prj = test.getproject(wks, 1)
- cs2005.commonProperties(prj)
- end
-
-
----
--- Visual Studio 2012 omits and .
----
-
- function suite.onDefaultCommonProps()
- prepare()
- test.capture [[
-
- ]]
- end
+--
+-- tests/actions/vstudio/cs2005/test_common_props.lua
+-- Check Visual Studio 2012 extensions to the project properties block.
+-- Copyright (c) 2013 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vs2012_csproj_common_props")
+ local cs2005 = p.vstudio.cs2005
+
+
+--
+-- Setup
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2012")
+ wks = test.createWorkspace()
+ language "C#"
+ end
+
+ local function prepare()
+ prj = test.getproject(wks, 1)
+ cs2005.commonProperties(prj)
+ end
+
+
+---
+-- Visual Studio 2012 omits and .
+---
+
+ function suite.onDefaultCommonProps()
+ prepare()
+ test.capture [[
+
+ ]]
+ end
diff --git a/tests/actions/vstudio/cs2005/test_compiler_props.lua b/modules/vstudio/tests/cs2005/test_compiler_props.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_compiler_props.lua
rename to modules/vstudio/tests/cs2005/test_compiler_props.lua
diff --git a/tests/actions/vstudio/cs2005/test_debug_props.lua b/modules/vstudio/tests/cs2005/test_debug_props.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_debug_props.lua
rename to modules/vstudio/tests/cs2005/test_debug_props.lua
diff --git a/tests/actions/vstudio/cs2005/test_files.lua b/modules/vstudio/tests/cs2005/test_files.lua
old mode 100755
new mode 100644
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_files.lua
rename to modules/vstudio/tests/cs2005/test_files.lua
diff --git a/tests/actions/vstudio/cs2005/test_icon.lua b/modules/vstudio/tests/cs2005/test_icon.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_icon.lua
rename to modules/vstudio/tests/cs2005/test_icon.lua
diff --git a/tests/actions/vstudio/cs2005/test_nuget_config.lua b/modules/vstudio/tests/cs2005/test_nuget_config.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_nuget_config.lua
rename to modules/vstudio/tests/cs2005/test_nuget_config.lua
diff --git a/tests/actions/vstudio/cs2005/test_nuget_packages_config.lua b/modules/vstudio/tests/cs2005/test_nuget_packages_config.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_nuget_packages_config.lua
rename to modules/vstudio/tests/cs2005/test_nuget_packages_config.lua
diff --git a/tests/actions/vstudio/cs2005/test_output_props.lua b/modules/vstudio/tests/cs2005/test_output_props.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_output_props.lua
rename to modules/vstudio/tests/cs2005/test_output_props.lua
diff --git a/tests/actions/vstudio/cs2005/test_platform_groups.lua b/modules/vstudio/tests/cs2005/test_platform_groups.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_platform_groups.lua
rename to modules/vstudio/tests/cs2005/test_platform_groups.lua
diff --git a/tests/actions/vstudio/cs2005/test_project_refs.lua b/modules/vstudio/tests/cs2005/test_project_refs.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_project_refs.lua
rename to modules/vstudio/tests/cs2005/test_project_refs.lua
diff --git a/tests/actions/vstudio/cs2005/test_targets.lua b/modules/vstudio/tests/cs2005/test_targets.lua
similarity index 95%
rename from tests/actions/vstudio/cs2005/test_targets.lua
rename to modules/vstudio/tests/cs2005/test_targets.lua
index 4e0b3300..bf76f311 100644
--- a/tests/actions/vstudio/cs2005/test_targets.lua
+++ b/modules/vstudio/tests/cs2005/test_targets.lua
@@ -1,46 +1,46 @@
---
--- tests/actions/vstudio/cs2005/test_targets.lua
--- Check Visual Studio 2012 extensions to the targets block.
--- Copyright (c) 2013 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vs2012_csproj_targets")
- local cs2005 = p.vstudio.cs2005
-
-
---
--- Setup
---
-
- local wks, prj
-
- function suite.setup()
- p.action.set("vs2012")
- wks = test.createWorkspace()
- language "C#"
- end
-
- local function prepare()
- prj = test.getproject(wks, 1)
- cs2005.targets(prj)
- end
-
-
----
--- Visual Studio 2012 changes the MS Build path slightly.
----
-
- function suite.on2012()
- prepare()
- test.capture [[
-
-
- ]]
- end
+--
+-- tests/actions/vstudio/cs2005/test_targets.lua
+-- Check Visual Studio 2012 extensions to the targets block.
+-- Copyright (c) 2013 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vs2012_csproj_targets")
+ local cs2005 = p.vstudio.cs2005
+
+
+--
+-- Setup
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2012")
+ wks = test.createWorkspace()
+ language "C#"
+ end
+
+ local function prepare()
+ prj = test.getproject(wks, 1)
+ cs2005.targets(prj)
+ end
+
+
+---
+-- Visual Studio 2012 changes the MS Build path slightly.
+---
+
+ function suite.on2012()
+ prepare()
+ test.capture [[
+
+
+ ]]
+ end
diff --git a/tests/actions/vstudio/cs2005/test_user_file.lua b/modules/vstudio/tests/cs2005/test_user_file.lua
similarity index 100%
rename from tests/actions/vstudio/cs2005/test_user_file.lua
rename to modules/vstudio/tests/cs2005/test_user_file.lua
diff --git a/tests/actions/vstudio/sln2005/test_dependencies.lua b/modules/vstudio/tests/sln2005/test_dependencies.lua
old mode 100755
new mode 100644
similarity index 96%
rename from tests/actions/vstudio/sln2005/test_dependencies.lua
rename to modules/vstudio/tests/sln2005/test_dependencies.lua
index 6d2e585f..583db6b6
--- a/tests/actions/vstudio/sln2005/test_dependencies.lua
+++ b/modules/vstudio/tests/sln2005/test_dependencies.lua
@@ -1,97 +1,97 @@
---
--- tests/actions/vstudio/sln2005/test_dependencies.lua
--- Validate generation of Visual Studio 2005+ solution project dependencies.
--- Copyright (c) 2009-2012 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vstudio_sln2005_dependencies")
- local sln2005 = p.vstudio.sln2005
-
-
---
--- Setup
---
-
- local wks, prj1, prj2
-
- function suite.setup()
- p.action.set("vs2005")
- wks, prj1 = test.createWorkspace()
- uuid "AE61726D-187C-E440-BD07-2556188A6565"
- prj2 = test.createproject(wks)
- uuid "2151E83B-997F-4A9D-955D-380157E88C31"
- prj3 = test.createproject(wks)
- uuid "CAA68162-8B96-11E1-8D5E-5885BBE59B18"
- links "MyProject"
- dependson "MyProject2"
- end
-
- local function prepare(language)
- prj1.language = language
- prj2.language = language
- prj2 = test.getproject(wks, 2)
- sln2005.projectdependencies(prj2)
- prj3.language = language
- prj3 = test.getproject(wks, 3)
- sln2005.projectdependencies(prj3)
- end
-
-
---
--- Verify dependencies between C++ projects are listed.
---
- function suite.dependency_onCppProjects()
- prepare("C++")
- test.capture [[
-ProjectSection(ProjectDependencies) = postProject
- {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
-EndProjectSection
- ]]
- end
-
-
---
--- Verify dependencies between C# projects are listed.
---
-
- function suite.dependency_onCSharpProjects()
- prepare("C#")
- test.capture [[
-ProjectSection(ProjectDependencies) = postProject
- {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
-EndProjectSection
- ]]
- end
-
-
---
--- Most C# references should go into the project rather than the solution,
--- but until I know the conditions, put everything here to be safe.
---
-
- function suite.dependency_onCSharpProjectsVs2010()
- p.action.set("vs2010")
- prepare("C#")
- test.capture [[
-ProjectSection(ProjectDependencies) = postProject
- {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
-EndProjectSection
- ]]
- end
-
-
-
---
--- Verify dependencies between projects C# are listed for VS2012.
---
-
- function suite.dependency_onCSharpProjectsVs2012()
- p.action.set("vs2012")
- prepare("C#")
- test.capture [[
-ProjectSection(ProjectDependencies) = postProject
- {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
-EndProjectSection
- ]]
- end
+--
+-- tests/actions/vstudio/sln2005/test_dependencies.lua
+-- Validate generation of Visual Studio 2005+ solution project dependencies.
+-- Copyright (c) 2009-2012 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vstudio_sln2005_dependencies")
+ local sln2005 = p.vstudio.sln2005
+
+
+--
+-- Setup
+--
+
+ local wks, prj1, prj2
+
+ function suite.setup()
+ p.action.set("vs2005")
+ wks, prj1 = test.createWorkspace()
+ uuid "AE61726D-187C-E440-BD07-2556188A6565"
+ prj2 = test.createproject(wks)
+ uuid "2151E83B-997F-4A9D-955D-380157E88C31"
+ prj3 = test.createproject(wks)
+ uuid "CAA68162-8B96-11E1-8D5E-5885BBE59B18"
+ links "MyProject"
+ dependson "MyProject2"
+ end
+
+ local function prepare(language)
+ prj1.language = language
+ prj2.language = language
+ prj2 = test.getproject(wks, 2)
+ sln2005.projectdependencies(prj2)
+ prj3.language = language
+ prj3 = test.getproject(wks, 3)
+ sln2005.projectdependencies(prj3)
+ end
+
+
+--
+-- Verify dependencies between C++ projects are listed.
+--
+ function suite.dependency_onCppProjects()
+ prepare("C++")
+ test.capture [[
+ProjectSection(ProjectDependencies) = postProject
+ {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
+EndProjectSection
+ ]]
+ end
+
+
+--
+-- Verify dependencies between C# projects are listed.
+--
+
+ function suite.dependency_onCSharpProjects()
+ prepare("C#")
+ test.capture [[
+ProjectSection(ProjectDependencies) = postProject
+ {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
+EndProjectSection
+ ]]
+ end
+
+
+--
+-- Most C# references should go into the project rather than the solution,
+-- but until I know the conditions, put everything here to be safe.
+--
+
+ function suite.dependency_onCSharpProjectsVs2010()
+ p.action.set("vs2010")
+ prepare("C#")
+ test.capture [[
+ProjectSection(ProjectDependencies) = postProject
+ {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
+EndProjectSection
+ ]]
+ end
+
+
+
+--
+-- Verify dependencies between projects C# are listed for VS2012.
+--
+
+ function suite.dependency_onCSharpProjectsVs2012()
+ p.action.set("vs2012")
+ prepare("C#")
+ test.capture [[
+ProjectSection(ProjectDependencies) = postProject
+ {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31}
+EndProjectSection
+ ]]
+ end
diff --git a/tests/actions/vstudio/sln2005/test_header.lua b/modules/vstudio/tests/sln2005/test_header.lua
old mode 100755
new mode 100644
similarity index 100%
rename from tests/actions/vstudio/sln2005/test_header.lua
rename to modules/vstudio/tests/sln2005/test_header.lua
diff --git a/tests/actions/vstudio/sln2005/test_nested_projects.lua b/modules/vstudio/tests/sln2005/test_nested_projects.lua
similarity index 100%
rename from tests/actions/vstudio/sln2005/test_nested_projects.lua
rename to modules/vstudio/tests/sln2005/test_nested_projects.lua
diff --git a/tests/actions/vstudio/sln2005/test_platforms.lua b/modules/vstudio/tests/sln2005/test_platforms.lua
similarity index 100%
rename from tests/actions/vstudio/sln2005/test_platforms.lua
rename to modules/vstudio/tests/sln2005/test_platforms.lua
diff --git a/tests/actions/vstudio/sln2005/test_projects.lua b/modules/vstudio/tests/sln2005/test_projects.lua
old mode 100755
new mode 100644
similarity index 100%
rename from tests/actions/vstudio/sln2005/test_projects.lua
rename to modules/vstudio/tests/sln2005/test_projects.lua
diff --git a/tests/actions/vstudio/sln2005/test_sections.lua b/modules/vstudio/tests/sln2005/test_sections.lua
similarity index 100%
rename from tests/actions/vstudio/sln2005/test_sections.lua
rename to modules/vstudio/tests/sln2005/test_sections.lua
diff --git a/tests/actions/vstudio/vc200x/test_assembly_refs.lua b/modules/vstudio/tests/vc200x/test_assembly_refs.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_assembly_refs.lua
rename to modules/vstudio/tests/vc200x/test_assembly_refs.lua
diff --git a/tests/actions/vstudio/vc200x/test_build_steps.lua b/modules/vstudio/tests/vc200x/test_build_steps.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_build_steps.lua
rename to modules/vstudio/tests/vc200x/test_build_steps.lua
diff --git a/tests/actions/vstudio/vc200x/test_compiler_block.lua b/modules/vstudio/tests/vc200x/test_compiler_block.lua
similarity index 94%
rename from tests/actions/vstudio/vc200x/test_compiler_block.lua
rename to modules/vstudio/tests/vc200x/test_compiler_block.lua
index e409f51b..2aaee360 100644
--- a/tests/actions/vstudio/vc200x/test_compiler_block.lua
+++ b/modules/vstudio/tests/vc200x/test_compiler_block.lua
@@ -1,681 +1,681 @@
---
--- tests/actions/vstudio/vc200x/test_compiler_block.lua
--- Validate generation the VCCLCompiler element in Visual Studio 200x C/C++ projects.
--- Copyright (c) 2011-2013 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vs200x_compiler_block")
- local vc200x = p.vstudio.vc200x
-
-
---
--- Setup/teardown
---
-
- local wks, prj
-
- function suite.setup()
- p.action.set("vs2008")
- wks, prj = test.createWorkspace()
- end
-
- local function prepare()
- local cfg = test.getconfig(prj, "Debug")
- vc200x.VCCLCompilerTool(cfg)
- end
-
-
---
--- Verify the basic structure of the compiler block with no flags or settings.
---
-
- function suite.looksGood_onDefaultSettings()
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- If include directories are specified, the should be added.
---
-
-
- function suite.additionalIncludeDirs_onIncludeDirs()
- includedirs { "include/lua", "include/zlib" }
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the handling of the Symbols in conjunction with the Optimize flag.
--- The release runtime library must be used.
---
-
- function suite.looksGood_onSymbolsAndOptimizeFlags()
- symbols "On"
- optimize "On"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the handling of the C7 debug information format.
---
-
- function suite.looksGood_onC7DebugFormat()
- symbols "On"
- debugformat "C7"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
----
--- Test precompiled header handling; the header should be treated as
--- a plain string value, with no path manipulation applied, since it
--- needs to match the value of the #include statement used in the
--- project code.
----
-
- function suite.compilerBlock_OnPCH()
- location "build"
- pchheader "include/common.h"
- pchsource "source/common.cpp"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Floating point flag tests
---
-
- function suite.compilerBlock_OnFpFast()
- floatingpoint "Fast"
- prepare()
- test.capture [[
-
- ]]
- end
-
- function suite.compilerBlock_OnFpStrict()
- floatingpoint "Strict"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Check that the "minimal rebuild" flag is applied correctly.
---
-
- function suite.minimalRebuildFlagsSet_onMinimalRebuildAndSymbols()
- flags { "NoMinimalRebuild" }
- symbols "On"
- prepare()
- test.capture [[
-
- ]]
- end
-
---
--- Check that the "no buffer security check" flag is applied correctly.
---
-
- function suite.noBufferSecurityFlagSet_onBufferSecurityCheck()
- flags { "NoBufferSecurityCheck" }
- prepare()
- test.capture [[
-
- ]]
- end
-
---
--- Check that the CompileAs value is set correctly for C language projects.
---
-
- function suite.compileAsSet_onC()
- language "C"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the correct runtime library is used when symbols are enabled.
---
-
- function suite.runtimeLibraryIsDebug_onSymbolsNoOptimize()
- symbols "On"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the correct warnings settings are used when extra warnings are enabled.
---
-
- function suite.runtimeLibraryIsDebug_onExtraWarnings()
- warnings "Extra"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the correct warnings settings are used when FatalWarnings are enabled.
---
-
- function suite.runtimeLibraryIsDebug_onFatalWarnings()
- flags { "FatalWarnings" }
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the correct warnings settings are used when no warnings are enabled.
---
-
- function suite.runtimeLibraryIsDebug_onNoWarnings_whichDisablesAllOtherWarningsFlags()
- flags { "FatalWarnings" }
- warnings "Off"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the correct Detect64BitPortabilityProblems settings are used when _ACTION < "VS2008".
---
-
- function suite._64BitPortabilityOn_onVS2005()
- p.action.set("vs2005")
- prepare()
- test.capture [[
-
- ]]
- end
-
- function suite._64BitPortabilityOff_onVS2005_andCLR()
- p.action.set("vs2005")
- clr "On"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the correct warnings settings are used when no warnings are enabled.
---
-
- function suite.runtimeLibraryIsDebug_onVS2005_NoWarnings()
- p.action.set("vs2005")
- warnings "Off"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Xbox 360 uses the same structure, but changes the element name.
---
-
- function suite.looksGood_onXbox360()
- system "Xbox360"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Check handling of forced includes.
---
-
- function suite.forcedIncludeFiles()
- forceincludes { "stdafx.h", "include/sys.h" }
- prepare()
- test.capture [[
-
+ ]]
+ end
+
+
+--
+-- If include directories are specified, the should be added.
+--
+
+
+ function suite.additionalIncludeDirs_onIncludeDirs()
+ includedirs { "include/lua", "include/zlib" }
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the handling of the Symbols in conjunction with the Optimize flag.
+-- The release runtime library must be used.
+--
+
+ function suite.looksGood_onSymbolsAndOptimizeFlags()
+ symbols "On"
+ optimize "On"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the handling of the C7 debug information format.
+--
+
+ function suite.looksGood_onC7DebugFormat()
+ symbols "On"
+ debugformat "C7"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+---
+-- Test precompiled header handling; the header should be treated as
+-- a plain string value, with no path manipulation applied, since it
+-- needs to match the value of the #include statement used in the
+-- project code.
+---
+
+ function suite.compilerBlock_OnPCH()
+ location "build"
+ pchheader "include/common.h"
+ pchsource "source/common.cpp"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Floating point flag tests
+--
+
+ function suite.compilerBlock_OnFpFast()
+ floatingpoint "Fast"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+ function suite.compilerBlock_OnFpStrict()
+ floatingpoint "Strict"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Check that the "minimal rebuild" flag is applied correctly.
+--
+
+ function suite.minimalRebuildFlagsSet_onMinimalRebuildAndSymbols()
+ flags { "NoMinimalRebuild" }
+ symbols "On"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+--
+-- Check that the "no buffer security check" flag is applied correctly.
+--
+
+ function suite.noBufferSecurityFlagSet_onBufferSecurityCheck()
+ flags { "NoBufferSecurityCheck" }
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+--
+-- Check that the CompileAs value is set correctly for C language projects.
+--
+
+ function suite.compileAsSet_onC()
+ language "C"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the correct runtime library is used when symbols are enabled.
+--
+
+ function suite.runtimeLibraryIsDebug_onSymbolsNoOptimize()
+ symbols "On"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the correct warnings settings are used when extra warnings are enabled.
+--
+
+ function suite.runtimeLibraryIsDebug_onExtraWarnings()
+ warnings "Extra"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the correct warnings settings are used when FatalWarnings are enabled.
+--
+
+ function suite.runtimeLibraryIsDebug_onFatalWarnings()
+ flags { "FatalWarnings" }
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the correct warnings settings are used when no warnings are enabled.
+--
+
+ function suite.runtimeLibraryIsDebug_onNoWarnings_whichDisablesAllOtherWarningsFlags()
+ flags { "FatalWarnings" }
+ warnings "Off"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the correct Detect64BitPortabilityProblems settings are used when _ACTION < "VS2008".
+--
+
+ function suite._64BitPortabilityOn_onVS2005()
+ p.action.set("vs2005")
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+ function suite._64BitPortabilityOff_onVS2005_andCLR()
+ p.action.set("vs2005")
+ clr "On"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the correct warnings settings are used when no warnings are enabled.
+--
+
+ function suite.runtimeLibraryIsDebug_onVS2005_NoWarnings()
+ p.action.set("vs2005")
+ warnings "Off"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Xbox 360 uses the same structure, but changes the element name.
+--
+
+ function suite.looksGood_onXbox360()
+ system "Xbox360"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Check handling of forced includes.
+--
+
+ function suite.forcedIncludeFiles()
+ forceincludes { "stdafx.h", "include/sys.h" }
+ prepare()
+ test.capture [[
+
- ]]
- end
-
-
---
--- If a platform is specified, it should be included in the platform name.
---
-
- function suite.usesWin32_onX86()
- workspace("MyWorkspace")
- platforms { "x86" }
- prepare()
- test.capture [[
-
- ]]
- end
-
- function suite.defaultSettings_onNone()
- kind "None"
- prepare()
- test.capture [[
-
- ]]
- end
+--
+-- tests/actions/vstudio/vc200x/test_configuration.lua
+-- Test the Visual Studio 2002-2008 project's Configuration block
+-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vstudio_vc200x_configuration")
+ local vstudio = p.vstudio
+ local vc200x = p.vstudio.vc200x
+ local project = p.project
+
+
+--
+-- Setup
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2008")
+ wks, prj = test.createWorkspace()
+ end
+
+ local function prepare()
+ local cfg = test.getconfig(prj, "Debug", (prj.platforms or wks.platforms or {})[1])
+ vc200x.configuration(cfg, vstudio.projectConfig(cfg))
+ end
+
+
+--
+-- Check the results of generating with the default project settings
+-- (C++ console application).
+--
+
+ function suite.defaultSettings()
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- If a platform is specified, it should be included in the platform name.
+--
+
+ function suite.usesWin32_onX86()
+ workspace("MyWorkspace")
+ platforms { "x86" }
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+ function suite.defaultSettings_onNone()
+ kind "None"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
diff --git a/tests/actions/vstudio/vc200x/test_debug_settings.lua b/modules/vstudio/tests/vc200x/test_debug_settings.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_debug_settings.lua
rename to modules/vstudio/tests/vc200x/test_debug_settings.lua
diff --git a/tests/actions/vstudio/vc200x/test_excluded_configs.lua b/modules/vstudio/tests/vc200x/test_excluded_configs.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_excluded_configs.lua
rename to modules/vstudio/tests/vc200x/test_excluded_configs.lua
diff --git a/tests/actions/vstudio/vc200x/test_files.lua b/modules/vstudio/tests/vc200x/test_files.lua
similarity index 94%
rename from tests/actions/vstudio/vc200x/test_files.lua
rename to modules/vstudio/tests/vc200x/test_files.lua
index d503bcae..2fa1b17f 100644
--- a/tests/actions/vstudio/vc200x/test_files.lua
+++ b/modules/vstudio/tests/vc200x/test_files.lua
@@ -1,695 +1,695 @@
---
--- tests/actions/vstudio/vc200x/test_files.lua
--- Validate generation of block in Visual Studio 200x projects.
--- Copyright (c) 2009-2014 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vstudio_vs200x_files")
- local vc200x = p.vstudio.vc200x
-
-
---
--- Setup
---
-
- local wks, prj
-
- function suite.setup()
- p.action.set("vs2008")
- p.escaper(p.vstudio.vs2005.esc)
- wks = test.createWorkspace()
- end
-
- local function prepare()
- prj = test.getproject(wks, 1)
- vc200x.files(prj)
- end
-
-
---
--- Check the structure of an individual file element.
---
-
- function suite.file_onDefaults()
- files { "hello.cpp" }
- prepare()
- test.capture [[
-
-
-
- ]]
- end
-
-
---
--- Check the structure of a file contained in a folder.
---
-
- function suite.file_onSingleLevelFolder()
- files { "src/hello.cpp", "so_long.cpp" }
- prepare()
- test.capture [[
-
-
-
-
-
-
-
- ]]
- end
-
-
---
--- Check the structure of a file contained in multiple folders.
---
-
- function suite.file_onMultipleFolderLevels()
- files { "src/greetings/hello.cpp", "so_long.cpp" }
- prepare()
- test.capture [[
-
-
-
-
-
-
-
-
-
- ]]
- end
-
-
---
--- Check the structure of a file with a virtual path.
---
-
- function suite.file_onVpath()
- files { "src/hello.cpp", "so_long.h" }
- vpaths { ["Source Files"] = "**.cpp" }
- prepare()
- test.capture [[
-
-
-
-
-
- ]]
- end
-
-
---
--- Make sure that the special "build a C code" logic only gets triggered
--- by actual C source code files.
---
-
- function suite.file_markedAsNonBuildable_onSupportFiles()
- language "C"
- files { "hello.lua" }
- prepare()
- test.capture [[
-
-
-
- ]]
- end
-
-
---
--- When a C code file is listed in a C++ project, it should still be
--- compiled as C (and not C++), and vice versa.
---
-
- function suite.compileAsSet_onCFileInCppProject()
- language "C++"
- files { "hello.c" }
- prepare()
- test.capture [[
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]
- end
-
- function suite.excludedFromBuild_onExcludeFlag()
- files { "hello.cpp" }
- filter "files:hello.cpp"
- flags { "ExcludeFromBuild" }
- prepare()
- test.capture [[
-
-
-
-
-
-
-
-
-
- ]]
- end
-
- function suite.excludedFromBuild_onCustomBuildRule_excludedFile()
- files { "hello.cg" }
- filter "files:**.cg"
- buildcommands { "cgc $(InputFile)" }
- buildoutputs { "$(InputName).obj" }
- filter "Debug"
- removefiles { "hello.cg" }
- prepare()
- test.capture [[
-
-
-
-
-
-
- ]]
- end
-
- function suite.excludedFromBuild_onCustomBuildRule_excludeFlag()
- files { "hello.cg" }
- filter "files:**.cg"
- buildcommands { "cgc $(InputFile)" }
- buildoutputs { "$(InputName).obj" }
- flags { "ExcludeFromBuild" }
- prepare()
- test.capture [[
-
-
-
-
-
-
- ]]
- end
-
-
---
--- If a custom build rule is supplied, the custom build tool settings should be used.
---
-
- function suite.customBuildTool_onBuildRule()
- files { "hello.x" }
- filter "files:**.x"
- buildmessage "Compiling $(InputFile)"
- buildcommands {
- 'cxc -c "$(InputFile)" -o "$(IntDir)/$(InputName).xo"',
- 'c2o -c "$(IntDir)/$(InputName).xo" -o "$(IntDir)/$(InputName).obj"'
- }
- buildoutputs { "$(IntDir)/$(InputName).obj" }
- prepare()
- test.capture [[
-
-
-
-
-
- ]]
- end
-
- function suite.customBuildTool_onBuildRuleMultipleBuildOutputs()
- files { "hello.x" }
- filter "files:**.x"
- buildmessage "Compiling $(InputFile)"
- buildcommands {
- 'cp "$(InputFile)" "$(IntDir)/$(InputName).a"',
- 'cp "$(InputFile)" "$(IntDir)/$(InputName).b"'
- }
- buildoutputs { "$(IntDir)/$(InputName).a", "$(IntDir)/$(InputName).b" }
- prepare()
- test.capture [[
-
-
-
-
-
- ]]
- end
-
- function suite.customBuildTool_onBuildRuleWithTokens()
- files { "hello.x" }
- objdir "../tmp/%{cfg.name}"
- filter "files:**.x"
- buildmessage "Compiling $(InputFile)"
- buildcommands {
- 'cxc -c %{file.relpath} -o %{cfg.objdir}/%{file.basename}.xo',
- 'c2o -c %{cfg.objdir}/%{file.basename}.xo -o %{cfg.objdir}/%{file.basename}.obj'
- }
- buildoutputs { "%{cfg.objdir}/%{file.basename}.obj" }
- prepare()
- test.capture [[
-
-
-
-
-
- ]]
- end
-
- function suite.customBuildTool_onBuildRuleWithAdditionalInputs()
- files { "hello.x" }
- filter "files:**.x"
- buildmessage "Compiling $(InputFile)"
- buildcommands {
- 'cxc -c "$(InputFile)" -o "$(IntDir)/$(InputName).xo"',
- 'c2o -c "$(IntDir)/$(InputName).xo" -o "$(IntDir)/$(InputName).obj"'
- }
- buildoutputs { "$(IntDir)/$(InputName).obj" }
- buildinputs { "common.x.inc", "common.x.inc2" }
- prepare()
- test.capture [[
-
-
-
-
-
- ]]
- end
-
-
---
--- If two files at different folder levels have the same name, a different
--- object file name should be used for each.
---
-
- function suite.uniqueObjectNames_onSourceNameCollision()
- files { "hello.cpp", "greetings/hello.cpp" }
- prepare()
- test.capture [[
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]
- end
-
-
---
--- Check handling of per-file forced includes.
---
-
- function suite.forcedIncludeFiles()
- files { "hello.cpp" }
- filter "files:**.cpp"
- forceincludes { "../include/force1.h", "../include/force2.h" }
-
- prepare()
- test.capture [[
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- block in Visual Studio 200x projects.
+-- Copyright (c) 2009-2014 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vstudio_vs200x_files")
+ local vc200x = p.vstudio.vc200x
+
+
+--
+-- Setup
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2008")
+ p.escaper(p.vstudio.vs2005.esc)
+ wks = test.createWorkspace()
+ end
+
+ local function prepare()
+ prj = test.getproject(wks, 1)
+ vc200x.files(prj)
+ end
+
+
+--
+-- Check the structure of an individual file element.
+--
+
+ function suite.file_onDefaults()
+ files { "hello.cpp" }
+ prepare()
+ test.capture [[
+
+
+
+ ]]
+ end
+
+
+--
+-- Check the structure of a file contained in a folder.
+--
+
+ function suite.file_onSingleLevelFolder()
+ files { "src/hello.cpp", "so_long.cpp" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+
+ ]]
+ end
+
+
+--
+-- Check the structure of a file contained in multiple folders.
+--
+
+ function suite.file_onMultipleFolderLevels()
+ files { "src/greetings/hello.cpp", "so_long.cpp" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+
+
+
+ ]]
+ end
+
+
+--
+-- Check the structure of a file with a virtual path.
+--
+
+ function suite.file_onVpath()
+ files { "src/hello.cpp", "so_long.h" }
+ vpaths { ["Source Files"] = "**.cpp" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+ ]]
+ end
+
+
+--
+-- Make sure that the special "build a C code" logic only gets triggered
+-- by actual C source code files.
+--
+
+ function suite.file_markedAsNonBuildable_onSupportFiles()
+ language "C"
+ files { "hello.lua" }
+ prepare()
+ test.capture [[
+
+
+
+ ]]
+ end
+
+
+--
+-- When a C code file is listed in a C++ project, it should still be
+-- compiled as C (and not C++), and vice versa.
+--
+
+ function suite.compileAsSet_onCFileInCppProject()
+ language "C++"
+ files { "hello.c" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]
+ end
+
+ function suite.excludedFromBuild_onExcludeFlag()
+ files { "hello.cpp" }
+ filter "files:hello.cpp"
+ flags { "ExcludeFromBuild" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+
+
+
+ ]]
+ end
+
+ function suite.excludedFromBuild_onCustomBuildRule_excludedFile()
+ files { "hello.cg" }
+ filter "files:**.cg"
+ buildcommands { "cgc $(InputFile)" }
+ buildoutputs { "$(InputName).obj" }
+ filter "Debug"
+ removefiles { "hello.cg" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+ ]]
+ end
+
+ function suite.excludedFromBuild_onCustomBuildRule_excludeFlag()
+ files { "hello.cg" }
+ filter "files:**.cg"
+ buildcommands { "cgc $(InputFile)" }
+ buildoutputs { "$(InputName).obj" }
+ flags { "ExcludeFromBuild" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+ ]]
+ end
+
+
+--
+-- If a custom build rule is supplied, the custom build tool settings should be used.
+--
+
+ function suite.customBuildTool_onBuildRule()
+ files { "hello.x" }
+ filter "files:**.x"
+ buildmessage "Compiling $(InputFile)"
+ buildcommands {
+ 'cxc -c "$(InputFile)" -o "$(IntDir)/$(InputName).xo"',
+ 'c2o -c "$(IntDir)/$(InputName).xo" -o "$(IntDir)/$(InputName).obj"'
+ }
+ buildoutputs { "$(IntDir)/$(InputName).obj" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+ ]]
+ end
+
+ function suite.customBuildTool_onBuildRuleMultipleBuildOutputs()
+ files { "hello.x" }
+ filter "files:**.x"
+ buildmessage "Compiling $(InputFile)"
+ buildcommands {
+ 'cp "$(InputFile)" "$(IntDir)/$(InputName).a"',
+ 'cp "$(InputFile)" "$(IntDir)/$(InputName).b"'
+ }
+ buildoutputs { "$(IntDir)/$(InputName).a", "$(IntDir)/$(InputName).b" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+ ]]
+ end
+
+ function suite.customBuildTool_onBuildRuleWithTokens()
+ files { "hello.x" }
+ objdir "../tmp/%{cfg.name}"
+ filter "files:**.x"
+ buildmessage "Compiling $(InputFile)"
+ buildcommands {
+ 'cxc -c %{file.relpath} -o %{cfg.objdir}/%{file.basename}.xo',
+ 'c2o -c %{cfg.objdir}/%{file.basename}.xo -o %{cfg.objdir}/%{file.basename}.obj'
+ }
+ buildoutputs { "%{cfg.objdir}/%{file.basename}.obj" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+ ]]
+ end
+
+ function suite.customBuildTool_onBuildRuleWithAdditionalInputs()
+ files { "hello.x" }
+ filter "files:**.x"
+ buildmessage "Compiling $(InputFile)"
+ buildcommands {
+ 'cxc -c "$(InputFile)" -o "$(IntDir)/$(InputName).xo"',
+ 'c2o -c "$(IntDir)/$(InputName).xo" -o "$(IntDir)/$(InputName).obj"'
+ }
+ buildoutputs { "$(IntDir)/$(InputName).obj" }
+ buildinputs { "common.x.inc", "common.x.inc2" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+ ]]
+ end
+
+
+--
+-- If two files at different folder levels have the same name, a different
+-- object file name should be used for each.
+--
+
+ function suite.uniqueObjectNames_onSourceNameCollision()
+ files { "hello.cpp", "greetings/hello.cpp" }
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]
+ end
+
+
+--
+-- Check handling of per-file forced includes.
+--
+
+ function suite.forcedIncludeFiles()
+ files { "hello.cpp" }
+ filter "files:**.cpp"
+ forceincludes { "../include/force1.h", "../include/force2.h" }
+
+ prepare()
+ test.capture [[
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- ]]
- end
-
-
---
--- Verify the basic structure of windowed app linker block.
---
-
- function suite.onWindowedApp()
- kind "WindowedApp"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the basic structure of shared library linker block.
---
-
- function suite.onSharedLib()
- kind "SharedLib"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the basic structure of static library linker block.
---
-
- function suite.onStaticLib()
- kind "StaticLib"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Verify the handling of the Symbols flag.
---
-
- function suite.onSymbolsFlag()
- symbols "On"
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- If a module definition file is present, make sure it is specified.
---
-
- function suite.onModuleDefinitionFile()
- files { "MyProject.def" }
- prepare()
- test.capture [[
-
- ]]
- end
-
-
---
--- Links to system libraries should appear in the list, properly decorated.
---
-
- function suite.includesSystemLibs()
- links { "GL", "GLU" }
- prepare()
- test.capture [[
-
+ ]]
+ end
+
+
+--
+-- Verify the basic structure of windowed app linker block.
+--
+
+ function suite.onWindowedApp()
+ kind "WindowedApp"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the basic structure of shared library linker block.
+--
+
+ function suite.onSharedLib()
+ kind "SharedLib"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the basic structure of static library linker block.
+--
+
+ function suite.onStaticLib()
+ kind "StaticLib"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Verify the handling of the Symbols flag.
+--
+
+ function suite.onSymbolsFlag()
+ symbols "On"
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- If a module definition file is present, make sure it is specified.
+--
+
+ function suite.onModuleDefinitionFile()
+ files { "MyProject.def" }
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- Links to system libraries should appear in the list, properly decorated.
+--
+
+ function suite.includesSystemLibs()
+ links { "GL", "GLU" }
+ prepare()
+ test.capture [[
+
- ]]
- end
-
-
---
--- If manifest file(s) are present, they should be listed.
---
-
- function suite.listsFiles_onManifests()
- files { "hello.c", "project1.manifest", "goodbye.c", "project2.manifest" }
- prepare()
- test.capture [[
-
- ]]
- end
+--
+-- tests/actions/vstudio/vc200x/test_manifest_block.lua
+-- Validate generation of VCManifest elements Visual Studio 200x C/C++ projects.
+-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vs200x_manifest_block")
+ local vc200x = p.vstudio.vc200x
+
+
+--
+-- Setup/teardown
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2008")
+ wks, prj = test.createWorkspace()
+ end
+
+ local function prepare()
+ local cfg = test.getconfig(prj, "Debug")
+ vc200x.VCManifestTool(cfg)
+ end
+
+
+--
+-- The manifest tool should empty if there are no manifest files.
+--
+
+ function suite.isEmpty_onNoManifests()
+ files { "hello.c" }
+ prepare()
+ test.capture [[
+
+ ]]
+ end
+
+
+--
+-- If manifest file(s) are present, they should be listed.
+--
+
+ function suite.listsFiles_onManifests()
+ files { "hello.c", "project1.manifest", "goodbye.c", "project2.manifest" }
+ prepare()
+ test.capture [[
+
+ ]]
+ end
diff --git a/tests/actions/vstudio/vc200x/test_nmake_settings.lua b/modules/vstudio/tests/vc200x/test_nmake_settings.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_nmake_settings.lua
rename to modules/vstudio/tests/vc200x/test_nmake_settings.lua
diff --git a/tests/actions/vstudio/vc200x/test_platforms.lua b/modules/vstudio/tests/vc200x/test_platforms.lua
old mode 100755
new mode 100644
similarity index 94%
rename from tests/actions/vstudio/vc200x/test_platforms.lua
rename to modules/vstudio/tests/vc200x/test_platforms.lua
index ab3782dc..3ad18271
--- a/tests/actions/vstudio/vc200x/test_platforms.lua
+++ b/modules/vstudio/tests/vc200x/test_platforms.lua
@@ -1,97 +1,97 @@
---
--- tests/actions/vstudio/vc200x/test_platforms.lua
--- Test the Visual Studio 2002-2008 project's Platforms block
--- Copyright (c) 2009-2012 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vstudio_vc200x_platforms")
- local vc200x = p.vstudio.vc200x
-
-
---
--- Setup
---
-
- local wks, prj
-
- function suite.setup()
- p.action.set("vs2008")
- wks = test.createWorkspace()
- end
-
- local function prepare()
- prj = test.getproject(wks, 1)
- vc200x.platforms(prj)
- end
-
-
---
--- If no architectures are specified, Win32 should be the default.
---
-
- function suite.win32Listed_onNoPlatforms()
- prepare()
- test.capture [[
-
-
-
- ]]
- end
-
-
---
--- If multiple configurations use the same architecture, it should
--- still only be listed once.
---
-
- function suite.architectureListedOnlyOnce_onMultipleConfigurations()
- platforms { "Static", "Dynamic" }
- prepare()
- test.capture [[
-
-
-
- ]]
- end
-
-
---
--- If multiple architectures are used, they should all be listed.
---
-
- function suite.allArchitecturesListed_onMultipleArchitectures()
- platforms { "x86", "x86_64" }
- prepare()
- test.capture [[
-
-
-
-
- ]]
- end
-
-
---
--- Verify the Xbox360 platform.
---
-
- function suite.platformIsCorrect_onXbox360()
- platforms { "Xbox360" }
- prepare()
- test.capture [[
-
-
-
- ]]
- end
+--
+-- tests/actions/vstudio/vc200x/test_platforms.lua
+-- Test the Visual Studio 2002-2008 project's Platforms block
+-- Copyright (c) 2009-2012 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vstudio_vc200x_platforms")
+ local vc200x = p.vstudio.vc200x
+
+
+--
+-- Setup
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2008")
+ wks = test.createWorkspace()
+ end
+
+ local function prepare()
+ prj = test.getproject(wks, 1)
+ vc200x.platforms(prj)
+ end
+
+
+--
+-- If no architectures are specified, Win32 should be the default.
+--
+
+ function suite.win32Listed_onNoPlatforms()
+ prepare()
+ test.capture [[
+
+
+
+ ]]
+ end
+
+
+--
+-- If multiple configurations use the same architecture, it should
+-- still only be listed once.
+--
+
+ function suite.architectureListedOnlyOnce_onMultipleConfigurations()
+ platforms { "Static", "Dynamic" }
+ prepare()
+ test.capture [[
+
+
+
+ ]]
+ end
+
+
+--
+-- If multiple architectures are used, they should all be listed.
+--
+
+ function suite.allArchitecturesListed_onMultipleArchitectures()
+ platforms { "x86", "x86_64" }
+ prepare()
+ test.capture [[
+
+
+
+
+ ]]
+ end
+
+
+--
+-- Verify the Xbox360 platform.
+--
+
+ function suite.platformIsCorrect_onXbox360()
+ platforms { "Xbox360" }
+ prepare()
+ test.capture [[
+
+
+
+ ]]
+ end
diff --git a/tests/actions/vstudio/vc200x/test_project.lua b/modules/vstudio/tests/vc200x/test_project.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_project.lua
rename to modules/vstudio/tests/vc200x/test_project.lua
diff --git a/tests/actions/vstudio/vc200x/test_project_refs.lua b/modules/vstudio/tests/vc200x/test_project_refs.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_project_refs.lua
rename to modules/vstudio/tests/vc200x/test_project_refs.lua
diff --git a/tests/actions/vstudio/vc200x/test_resource_compiler.lua b/modules/vstudio/tests/vc200x/test_resource_compiler.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_resource_compiler.lua
rename to modules/vstudio/tests/vc200x/test_resource_compiler.lua
diff --git a/tests/actions/vstudio/vc200x/test_user_file.lua b/modules/vstudio/tests/vc200x/test_user_file.lua
similarity index 100%
rename from tests/actions/vstudio/vc200x/test_user_file.lua
rename to modules/vstudio/tests/vc200x/test_user_file.lua
diff --git a/tests/actions/vstudio/vc2010/test_assembly_refs.lua b/modules/vstudio/tests/vc2010/test_assembly_refs.lua
similarity index 100%
rename from tests/actions/vstudio/vc2010/test_assembly_refs.lua
rename to modules/vstudio/tests/vc2010/test_assembly_refs.lua
diff --git a/tests/actions/vstudio/vc2010/test_build_events.lua b/modules/vstudio/tests/vc2010/test_build_events.lua
similarity index 100%
rename from tests/actions/vstudio/vc2010/test_build_events.lua
rename to modules/vstudio/tests/vc2010/test_build_events.lua
diff --git a/tests/actions/vstudio/vc2010/test_build_log.lua b/modules/vstudio/tests/vc2010/test_build_log.lua
similarity index 100%
rename from tests/actions/vstudio/vc2010/test_build_log.lua
rename to modules/vstudio/tests/vc2010/test_build_log.lua
diff --git a/tests/actions/vstudio/vc2010/test_character_set.lua b/modules/vstudio/tests/vc2010/test_character_set.lua
similarity index 100%
rename from tests/actions/vstudio/vc2010/test_character_set.lua
rename to modules/vstudio/tests/vc2010/test_character_set.lua
diff --git a/tests/actions/vstudio/vc2010/test_compile_settings.lua b/modules/vstudio/tests/vc2010/test_compile_settings.lua
similarity index 95%
rename from tests/actions/vstudio/vc2010/test_compile_settings.lua
rename to modules/vstudio/tests/vc2010/test_compile_settings.lua
index 563f6bd2..420cc68f 100644
--- a/tests/actions/vstudio/vc2010/test_compile_settings.lua
+++ b/modules/vstudio/tests/vc2010/test_compile_settings.lua
@@ -1,1159 +1,1159 @@
---
--- tests/actions/vstudio/vc2010/test_compile_settings.lua
--- Validate compiler settings in Visual Studio 2010 C/C++ projects.
--- Copyright (c) 2011-2013 Jason Perkins and the Premake project
---
-
- local p = premake
- local suite = test.declare("vstudio_vs2010_compile_settings")
- local vc2010 = p.vstudio.vc2010
- local project = p.project
-
-
---
--- Setup
---
-
- local wks, prj
-
- function suite.setup()
- p.action.set("vs2010")
- wks, prj = test.createWorkspace()
- end
-
- local function prepare(platform)
- local cfg = test.getconfig(prj, "Debug", platform)
- vc2010.clCompile(cfg)
- end
-
-
---
--- Check the basic element structure with default settings.
----
-
- function suite.defaultSettings()
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
-
----
--- Test precompiled header handling; the header should be treated as
--- a plain string value, with no path manipulation applied, since it
--- needs to match the value of the #include statement used in the
--- project code.
----
-
- function suite.usePrecompiledHeaders_onPrecompiledHeaders()
- location "build"
- pchheader "include/afxwin.h"
- prepare()
- test.capture [[
-
- Use
- include/afxwin.h
- ]]
- end
-
-
----
--- The NoPCH flag should override any other PCH settings.
----
-
- function suite.noPrecompiledHeaders_onNoPCH()
- pchheader "afxwin.h"
- flags "NoPCH"
- prepare()
- test.capture [[
-
- NotUsing
- ]]
- end
-
-
---
--- If extra warnings is specified, pump up the volume.
---
-
- function suite.warningLevel_onExtraWarnings()
- warnings "Extra"
- prepare()
- test.capture [[
-
- NotUsing
- Level4
- ]]
- end
-
---
--- If the warnings are disabled, mute all warnings.
---
-
- function suite.warningLevel_onNoWarnings()
- warnings "Off"
- prepare()
- test.capture [[
-
- NotUsing
- TurnOffAllWarnings
- ]]
- end
-
---
--- If warnings are turned off, the fatal warnings flags should
--- not be generated.
---
-
- function suite.warningLevel_onNoWarningsOverOtherWarningsFlags()
- flags { "FatalWarnings" }
- warnings "Off"
- prepare()
- test.capture [[
-
- NotUsing
- TurnOffAllWarnings
- ]]
- end
-
---
--- Disable specific warnings.
---
-
- function suite.disableSpecificWarnings()
- disablewarnings { "disable" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- disable;%(DisableSpecificWarnings)
- ]]
- end
-
---
--- Specific warnings as errors.
---
-
- function suite.specificWarningsAsErrors()
- fatalwarnings { "fatal" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- fatal;%(TreatSpecificWarningsAsErrors)
- ]]
- end
-
---
--- Check the optimization flags.
---
-
- function suite.optimization_onOptimize()
- optimize "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Full
- true
- true
- false
- true
- ]]
- end
-
- function suite.optimization_onOptimizeSize()
- optimize "Size"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- MinSpace
- true
- true
- false
- true
- ]]
- end
-
- function suite.optimization_onOptimizeSpeed()
- optimize "Speed"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- MaxSpeed
- true
- true
- false
- true
- ]]
- end
-
- function suite.optimization_onOptimizeFull()
- optimize "Full"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Full
- true
- true
- false
- true
- ]]
- end
-
- function suite.optimization_onOptimizeOff()
- optimize "Off"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
- function suite.optimization_onOptimizeDebug()
- optimize "Debug"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
- function suite.omitFrames_onNoFramePointer()
- flags "NoFramePointer"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- true
- ]]
- end
-
-
---
--- If defines are specified, the element should be added.
---
-
- function suite.preprocessorDefinitions_onDefines()
- defines { "DEBUG", "_DEBUG" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- DEBUG;_DEBUG;%(PreprocessorDefinitions)
- ]]
- end
-
-
---
--- If defines are specified with escapable characters, they should be escaped.
---
-
- function suite.preprocessorDefinitions_onDefines()
- p.escaper(p.vstudio.vs2010.esc)
- defines { "&", "<", ">" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- &;<;>;%(PreprocessorDefinitions)
- ]]
- p.escaper(nil)
- end
-
-
---
--- If undefines are specified, the element should be added.
---
-
- function suite.preprocessorDefinitions_onUnDefines()
- undefines { "DEBUG", "_DEBUG" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- DEBUG;_DEBUG;%(UndefinePreprocessorDefinitions)
- ]]
- end
-
-
---
--- If build options are specified, the element should be specified.
---
-
- function suite.additionalOptions_onBuildOptions()
- buildoptions { "/xyz", "/abc" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- /xyz /abc %(AdditionalOptions)
- ]]
- end
-
-
---
--- If include directories are specified, the should be added.
---
-
- function suite.additionalIncludeDirs_onIncludeDirs()
- includedirs { "include/lua", "include/zlib" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- include\lua;include\zlib;%(AdditionalIncludeDirectories)
- ]]
- end
-
-
-
---
--- Ensure macros are not truncated (see issue #63)
---
-
-
- function suite.additionalIncludeDirs_onIncludeDirs_with_vs_macros()
- includedirs { "$(Macro1)/foo/bar/$(Macro2)/baz" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- $(Macro1)\foo\bar\$(Macro2)\baz;%(AdditionalIncludeDirectories)
- ]]
- end
-
-
---
--- If include directories are specified, the should be added.
---
-
- function suite.additionalUsingDirs_onUsingDirs()
- usingdirs { "include/lua", "include/zlib" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- include\lua;include\zlib;%(AdditionalUsingDirectories)
- ]]
- end
-
---
--- Turn off minimal rebuilds if the NoMinimalRebuild flag is set.
---
-
- function suite.minimalRebuild_onNoMinimalRebuild()
- flags "NoMinimalRebuild"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
---
--- Can't minimal rebuild with the C7 debugging format.
---
-
- function suite.minimalRebuild_onC7()
- debugformat "C7"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
-
---
--- If the StaticRuntime flag is specified, add the element.
---
-
- function suite.runtimeLibrary_onStaticRuntime()
- flags { "StaticRuntime" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- MultiThreaded
- ]]
- end
-
- function suite.runtimeLibrary_onStaticRuntimeAndSymbols()
- flags { "StaticRuntime" }
- symbols "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- EditAndContinue
- Disabled
- MultiThreadedDebug
- ]]
- end
-
-
---
--- Add if FatalWarnings flag is set.
---
-
- function suite.treatWarningsAsError_onFatalWarnings()
- flags { "FatalCompileWarnings" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- true
- ]]
- end
-
-
---
--- Check the handling of the Symbols flag.
---
-
- function suite.onDefaultSymbols()
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
- function suite.onNoSymbols()
- symbols "Off"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- None
- Disabled
-
- ]]
- end
-
- function suite.onSymbols()
- symbols "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- EditAndContinue
- Disabled
-
- ]]
- end
-
-
---
--- Check the handling of the C7 debug information format.
---
-
- function suite.onC7DebugFormat()
- symbols "On"
- debugformat "c7"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- OldStyle
- Disabled
- ]]
- end
-
-
---
--- Verify character handling.
---
-
- function suite.wchar_onNative()
- flags "NativeWChar"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- true
- ]]
- end
-
- function suite.wchar_onNoNative()
- flags "NoNativeWChar"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
-
---
--- Check exception handling and RTTI.
---
-
- function suite.exceptions_onNoExceptions()
- exceptionhandling "Off"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
-
- function suite.exceptions_onNoExceptionsVS2013()
- exceptionhandling "Off"
- p.action.set("vs2013")
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)
- Disabled
- false
- ]]
- end
-
-
- function suite.exceptions_onSEH()
- exceptionhandling "SEH"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- Async
- ]]
- end
-
- function suite.runtimeTypeInfo_onNoRTTI()
- rtti "Off"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
- function suite.runtimeTypeInfo_onNoBufferSecurityCheck()
- flags "NoBufferSecurityCheck"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
-
---
--- On Win32 builds, use the Edit-and-Continue debug information format.
---
-
- function suite.debugFormat_onWin32()
- symbols "On"
- architecture "x86"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- EditAndContinue
- ]]
- end
-
-
---
--- Edit-and-Continue is not support on 64-bit builds.
---
-
- function suite.debugFormat_onWin64()
- symbols "On"
- architecture "x86_64"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- ProgramDatabase
- ]]
- end
-
-
---
--- Check the handling of the editandcontinue flag.
---
-
- function suite.debugFormat_onEditAndContinueOff()
- symbols "On"
- editandcontinue "Off"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- ProgramDatabase
- ]]
- end
-
---
--- Check the handling of the editandcontinue flag.
---
-
- function suite.debugFormat_onFastLinkBuild()
- symbols "FastLink"
- editandcontinue "Off"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- ProgramDatabase
- ]]
- end
-
-
---
--- Edit-and-Continue is not supported for optimized builds.
---
-
- function suite.debugFormat_onOptimizedBuild()
- symbols "On"
- optimize "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- ProgramDatabase
- ]]
- end
-
-
-
---
--- Edit-and-Continue is not supported for Managed builds.
---
-
- function suite.debugFormat_onManagedCode()
- symbols "On"
- clr "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- ProgramDatabase
- ]]
- end
-
-
---
--- Check handling of forced includes.
---
-
- function suite.forcedIncludeFiles()
- forceincludes { "stdafx.h", "include/sys.h" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- stdafx.h;include\sys.h
- ]]
- end
-
- function suite.forcedUsingFiles()
- forceusings { "stdafx.h", "include/sys.h" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- stdafx.h;include\sys.h
- ]]
- end
-
-
---
--- Check handling of the NoRuntimeChecks flag.
---
-
- function suite.onNoRuntimeChecks()
- flags { "NoRuntimeChecks" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Default
- ]]
- end
-
-
---
--- Check handling of the EnableMultiProcessorCompile flag.
---
-
- function suite.onMultiProcessorCompile()
- flags { "MultiProcessorCompile" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- true
- ]]
- end
-
-
---
--- Check handling of the ReleaseRuntime flag; should override the
--- default behavior of linking the debug runtime when symbols are
--- enabled with no optimizations.
---
-
- function suite.releaseRuntime_onStaticAndReleaseRuntime()
- flags { "ReleaseRuntime", "StaticRuntime" }
- symbols "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- EditAndContinue
- Disabled
- MultiThreaded
- ]]
- end
-
-
---
--- Check handling of the OmitDefaultLibrary flag.
---
-
- function suite.onOmitDefaultLibrary()
- flags { "OmitDefaultLibrary" }
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- true
- ]]
- end
-
-
---
--- Check handling of the explicitly disabling symbols.
--- Note: VS2013 and older have a bug with setting
--- DebugInformationFormat to None. The workaround
--- is to leave the field blank.
---
- function suite.onNoSymbols()
- symbols 'Off'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
-
- Disabled
- ]]
- end
-
-
---
--- VS2015 and newer can use DebugInformationFormat None.
---
- function suite.onNoSymbolsVS2015()
- symbols 'Off'
- p.action.set("vs2015")
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- None
- Disabled
- ]]
- end
-
-
---
--- Check handling of the stringpooling api
---
- function suite.onStringPoolingOff()
- stringpooling 'Off'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
- function suite.onStringPoolingOn()
- stringpooling 'On'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- true
- ]]
- end
-
- function suite.onStringPoolingNotSpecified()
- optimize "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Full
- true
- true
- false
- true
- ]]
- end
-
-
-
---
--- Check handling of the floatingpointexceptions api
---
- function suite.onFloatingPointExceptionsOff()
- floatingpointexceptions 'Off'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
- function suite.onFloatingPointExceptionsOn()
- floatingpointexceptions 'On'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- true
- ]]
- end
-
- function suite.onFloatingPointExceptionsNotSpecified()
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
-
-
---
--- Check handling of the functionlevellinking api
---
- function suite.onFunctionLevelLinkingOff()
- functionlevellinking 'Off'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
- function suite.onFunctionLevelLinkingOn()
- functionlevellinking 'On'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- true
- ]]
- end
-
- function suite.onFunctionLevelLinkingNotSpecified()
- optimize "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Full
- true
- ]]
- end
-
-
-
---
--- Check handling of the intrinsics api
---
- function suite.onIntrinsicsOff()
- intrinsics 'Off'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- false
- ]]
- end
-
- function suite.onIntrinsicsOn()
- intrinsics 'On'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- true
- ]]
- end
-
- function suite.onIntrinsicsNotSpecified()
- optimize "On"
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Full
- true
- true
- false
- true
- ]]
- end
-
-
-
---
--- Check handling of the language api
---
- function suite.onLanguageC()
- language 'C'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
- function suite.onLanguageCpp()
- language 'C++'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
-
---
--- Check handling of the compileAs api
---
- function suite.onCompileAsC()
- compileas 'C'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- CompileAsC
-
- ]]
- end
-
- function suite.onCompileAsCpp()
- compileas 'C++'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- CompileAsCpp
-
- ]]
- end
-
-
---
--- Check handling of the C++14 & C++17 api
---
-
- function suite.onLanguage_Cpp14_VS2010()
- cppdialect 'C++14'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
- function suite.onLanguage_Cpp14_VS2015()
- p.action.set("vs2015")
-
- cppdialect 'C++14'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- /std:c++14 %(AdditionalOptions)
-
- ]]
- end
-
- function suite.onLanguage_Cpp14_VS2017()
- p.action.set("vs2017")
-
- cppdialect 'C++14'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- stdcpp14
-
- ]]
- end
-
- function suite.onLanguage_Cpp17_VS2010()
- cppdialect 'C++17'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
-
- ]]
- end
-
- function suite.onLanguage_Cpp17_VS2015()
- p.action.set("vs2015")
-
- cppdialect 'C++17'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- /std:c++latest %(AdditionalOptions)
-
- ]]
- end
-
- function suite.onLanguage_Cpp17_VS2017()
- p.action.set("vs2017")
-
- cppdialect 'C++17'
- prepare()
- test.capture [[
-
- NotUsing
- Level3
- Disabled
- stdcpplatest
-
- ]]
- end
+--
+-- tests/actions/vstudio/vc2010/test_compile_settings.lua
+-- Validate compiler settings in Visual Studio 2010 C/C++ projects.
+-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
+--
+
+ local p = premake
+ local suite = test.declare("vstudio_vs2010_compile_settings")
+ local vc2010 = p.vstudio.vc2010
+ local project = p.project
+
+
+--
+-- Setup
+--
+
+ local wks, prj
+
+ function suite.setup()
+ p.action.set("vs2010")
+ wks, prj = test.createWorkspace()
+ end
+
+ local function prepare(platform)
+ local cfg = test.getconfig(prj, "Debug", platform)
+ vc2010.clCompile(cfg)
+ end
+
+
+--
+-- Check the basic element structure with default settings.
+---
+
+ function suite.defaultSettings()
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+
+ ]]
+ end
+
+
+---
+-- Test precompiled header handling; the header should be treated as
+-- a plain string value, with no path manipulation applied, since it
+-- needs to match the value of the #include statement used in the
+-- project code.
+---
+
+ function suite.usePrecompiledHeaders_onPrecompiledHeaders()
+ location "build"
+ pchheader "include/afxwin.h"
+ prepare()
+ test.capture [[
+
+ Use
+ include/afxwin.h
+ ]]
+ end
+
+
+---
+-- The NoPCH flag should override any other PCH settings.
+---
+
+ function suite.noPrecompiledHeaders_onNoPCH()
+ pchheader "afxwin.h"
+ flags "NoPCH"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ ]]
+ end
+
+
+--
+-- If extra warnings is specified, pump up the volume.
+--
+
+ function suite.warningLevel_onExtraWarnings()
+ warnings "Extra"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level4
+ ]]
+ end
+
+--
+-- If the warnings are disabled, mute all warnings.
+--
+
+ function suite.warningLevel_onNoWarnings()
+ warnings "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ TurnOffAllWarnings
+ ]]
+ end
+
+--
+-- If warnings are turned off, the fatal warnings flags should
+-- not be generated.
+--
+
+ function suite.warningLevel_onNoWarningsOverOtherWarningsFlags()
+ flags { "FatalWarnings" }
+ warnings "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ TurnOffAllWarnings
+ ]]
+ end
+
+--
+-- Disable specific warnings.
+--
+
+ function suite.disableSpecificWarnings()
+ disablewarnings { "disable" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ disable;%(DisableSpecificWarnings)
+ ]]
+ end
+
+--
+-- Specific warnings as errors.
+--
+
+ function suite.specificWarningsAsErrors()
+ fatalwarnings { "fatal" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ fatal;%(TreatSpecificWarningsAsErrors)
+ ]]
+ end
+
+--
+-- Check the optimization flags.
+--
+
+ function suite.optimization_onOptimize()
+ optimize "On"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Full
+ true
+ true
+ false
+ true
+ ]]
+ end
+
+ function suite.optimization_onOptimizeSize()
+ optimize "Size"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ MinSpace
+ true
+ true
+ false
+ true
+ ]]
+ end
+
+ function suite.optimization_onOptimizeSpeed()
+ optimize "Speed"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ MaxSpeed
+ true
+ true
+ false
+ true
+ ]]
+ end
+
+ function suite.optimization_onOptimizeFull()
+ optimize "Full"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Full
+ true
+ true
+ false
+ true
+ ]]
+ end
+
+ function suite.optimization_onOptimizeOff()
+ optimize "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+
+ ]]
+ end
+
+ function suite.optimization_onOptimizeDebug()
+ optimize "Debug"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+
+ ]]
+ end
+
+ function suite.omitFrames_onNoFramePointer()
+ flags "NoFramePointer"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ true
+ ]]
+ end
+
+
+--
+-- If defines are specified, the element should be added.
+--
+
+ function suite.preprocessorDefinitions_onDefines()
+ defines { "DEBUG", "_DEBUG" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ DEBUG;_DEBUG;%(PreprocessorDefinitions)
+ ]]
+ end
+
+
+--
+-- If defines are specified with escapable characters, they should be escaped.
+--
+
+ function suite.preprocessorDefinitions_onDefines()
+ p.escaper(p.vstudio.vs2010.esc)
+ defines { "&", "<", ">" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ &;<;>;%(PreprocessorDefinitions)
+ ]]
+ p.escaper(nil)
+ end
+
+
+--
+-- If undefines are specified, the element should be added.
+--
+
+ function suite.preprocessorDefinitions_onUnDefines()
+ undefines { "DEBUG", "_DEBUG" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ DEBUG;_DEBUG;%(UndefinePreprocessorDefinitions)
+ ]]
+ end
+
+
+--
+-- If build options are specified, the element should be specified.
+--
+
+ function suite.additionalOptions_onBuildOptions()
+ buildoptions { "/xyz", "/abc" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ /xyz /abc %(AdditionalOptions)
+ ]]
+ end
+
+
+--
+-- If include directories are specified, the should be added.
+--
+
+ function suite.additionalIncludeDirs_onIncludeDirs()
+ includedirs { "include/lua", "include/zlib" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ include\lua;include\zlib;%(AdditionalIncludeDirectories)
+ ]]
+ end
+
+
+
+--
+-- Ensure macros are not truncated (see issue #63)
+--
+
+
+ function suite.additionalIncludeDirs_onIncludeDirs_with_vs_macros()
+ includedirs { "$(Macro1)/foo/bar/$(Macro2)/baz" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ $(Macro1)\foo\bar\$(Macro2)\baz;%(AdditionalIncludeDirectories)
+ ]]
+ end
+
+
+--
+-- If include directories are specified, the should be added.
+--
+
+ function suite.additionalUsingDirs_onUsingDirs()
+ usingdirs { "include/lua", "include/zlib" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ include\lua;include\zlib;%(AdditionalUsingDirectories)
+ ]]
+ end
+
+--
+-- Turn off minimal rebuilds if the NoMinimalRebuild flag is set.
+--
+
+ function suite.minimalRebuild_onNoMinimalRebuild()
+ flags "NoMinimalRebuild"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ ]]
+ end
+
+--
+-- Can't minimal rebuild with the C7 debugging format.
+--
+
+ function suite.minimalRebuild_onC7()
+ debugformat "C7"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ ]]
+ end
+
+
+--
+-- If the StaticRuntime flag is specified, add the element.
+--
+
+ function suite.runtimeLibrary_onStaticRuntime()
+ flags { "StaticRuntime" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ MultiThreaded
+ ]]
+ end
+
+ function suite.runtimeLibrary_onStaticRuntimeAndSymbols()
+ flags { "StaticRuntime" }
+ symbols "On"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ EditAndContinue
+ Disabled
+ MultiThreadedDebug
+ ]]
+ end
+
+
+--
+-- Add if FatalWarnings flag is set.
+--
+
+ function suite.treatWarningsAsError_onFatalWarnings()
+ flags { "FatalCompileWarnings" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ true
+ ]]
+ end
+
+
+--
+-- Check the handling of the Symbols flag.
+--
+
+ function suite.onDefaultSymbols()
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+
+ ]]
+ end
+
+ function suite.onNoSymbols()
+ symbols "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ None
+ Disabled
+
+ ]]
+ end
+
+ function suite.onSymbols()
+ symbols "On"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ EditAndContinue
+ Disabled
+
+ ]]
+ end
+
+
+--
+-- Check the handling of the C7 debug information format.
+--
+
+ function suite.onC7DebugFormat()
+ symbols "On"
+ debugformat "c7"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ OldStyle
+ Disabled
+ ]]
+ end
+
+
+--
+-- Verify character handling.
+--
+
+ function suite.wchar_onNative()
+ flags "NativeWChar"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ true
+ ]]
+ end
+
+ function suite.wchar_onNoNative()
+ flags "NoNativeWChar"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ ]]
+ end
+
+
+--
+-- Check exception handling and RTTI.
+--
+
+ function suite.exceptions_onNoExceptions()
+ exceptionhandling "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ ]]
+ end
+
+
+ function suite.exceptions_onNoExceptionsVS2013()
+ exceptionhandling "Off"
+ p.action.set("vs2013")
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)
+ Disabled
+ false
+ ]]
+ end
+
+
+ function suite.exceptions_onSEH()
+ exceptionhandling "SEH"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ Async
+ ]]
+ end
+
+ function suite.runtimeTypeInfo_onNoRTTI()
+ rtti "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ ]]
+ end
+
+ function suite.runtimeTypeInfo_onNoBufferSecurityCheck()
+ flags "NoBufferSecurityCheck"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ ]]
+ end
+
+
+--
+-- On Win32 builds, use the Edit-and-Continue debug information format.
+--
+
+ function suite.debugFormat_onWin32()
+ symbols "On"
+ architecture "x86"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ EditAndContinue
+ ]]
+ end
+
+
+--
+-- Edit-and-Continue is not support on 64-bit builds.
+--
+
+ function suite.debugFormat_onWin64()
+ symbols "On"
+ architecture "x86_64"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ ProgramDatabase
+ ]]
+ end
+
+
+--
+-- Check the handling of the editandcontinue flag.
+--
+
+ function suite.debugFormat_onEditAndContinueOff()
+ symbols "On"
+ editandcontinue "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ ProgramDatabase
+ ]]
+ end
+
+--
+-- Check the handling of the editandcontinue flag.
+--
+
+ function suite.debugFormat_onFastLinkBuild()
+ symbols "FastLink"
+ editandcontinue "Off"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ ProgramDatabase
+ ]]
+ end
+
+
+--
+-- Edit-and-Continue is not supported for optimized builds.
+--
+
+ function suite.debugFormat_onOptimizedBuild()
+ symbols "On"
+ optimize "On"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ ProgramDatabase
+ ]]
+ end
+
+
+
+--
+-- Edit-and-Continue is not supported for Managed builds.
+--
+
+ function suite.debugFormat_onManagedCode()
+ symbols "On"
+ clr "On"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ ProgramDatabase
+ ]]
+ end
+
+
+--
+-- Check handling of forced includes.
+--
+
+ function suite.forcedIncludeFiles()
+ forceincludes { "stdafx.h", "include/sys.h" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ stdafx.h;include\sys.h
+ ]]
+ end
+
+ function suite.forcedUsingFiles()
+ forceusings { "stdafx.h", "include/sys.h" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ stdafx.h;include\sys.h
+ ]]
+ end
+
+
+--
+-- Check handling of the NoRuntimeChecks flag.
+--
+
+ function suite.onNoRuntimeChecks()
+ flags { "NoRuntimeChecks" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Default
+ ]]
+ end
+
+
+--
+-- Check handling of the EnableMultiProcessorCompile flag.
+--
+
+ function suite.onMultiProcessorCompile()
+ flags { "MultiProcessorCompile" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ true
+ ]]
+ end
+
+
+--
+-- Check handling of the ReleaseRuntime flag; should override the
+-- default behavior of linking the debug runtime when symbols are
+-- enabled with no optimizations.
+--
+
+ function suite.releaseRuntime_onStaticAndReleaseRuntime()
+ flags { "ReleaseRuntime", "StaticRuntime" }
+ symbols "On"
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ EditAndContinue
+ Disabled
+ MultiThreaded
+ ]]
+ end
+
+
+--
+-- Check handling of the OmitDefaultLibrary flag.
+--
+
+ function suite.onOmitDefaultLibrary()
+ flags { "OmitDefaultLibrary" }
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ true
+ ]]
+ end
+
+
+--
+-- Check handling of the explicitly disabling symbols.
+-- Note: VS2013 and older have a bug with setting
+-- DebugInformationFormat to None. The workaround
+-- is to leave the field blank.
+--
+ function suite.onNoSymbols()
+ symbols 'Off'
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+
+ Disabled
+ ]]
+ end
+
+
+--
+-- VS2015 and newer can use DebugInformationFormat None.
+--
+ function suite.onNoSymbolsVS2015()
+ symbols 'Off'
+ p.action.set("vs2015")
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ None
+ Disabled
+ ]]
+ end
+
+
+--
+-- Check handling of the stringpooling api
+--
+ function suite.onStringPoolingOff()
+ stringpooling 'Off'
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ false
+ ]]
+ end
+
+ function suite.onStringPoolingOn()
+ stringpooling 'On'
+ prepare()
+ test.capture [[
+
+ NotUsing
+ Level3
+ Disabled
+ true
+ ]]
+ end
+
+ function suite.onStringPoolingNotSpecified()
+ optimize "On"
+ prepare()
+ test.capture [[
+
+