mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 02:35:46 -04:00
Initial community commit
This commit is contained in:
30
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_make_escaping.lua
vendored
Normal file
30
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_make_escaping.lua
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
--
|
||||
-- tests/actions/make/test_make_escaping.lua
|
||||
-- Validate the escaping of literal values in Makefiles.
|
||||
-- Copyright (c) 2010 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.make_escaping = { }
|
||||
local suite = T.make_escaping
|
||||
|
||||
|
||||
function suite.Escapes_Spaces()
|
||||
test.isequal("Program\\ Files", _MAKE.esc("Program Files"))
|
||||
end
|
||||
|
||||
function suite.Escapes_Backslashes()
|
||||
test.isequal("Program\\\\Files", _MAKE.esc("Program\\Files"))
|
||||
end
|
||||
|
||||
function suite.Escapes_Parens()
|
||||
test.isequal("Debug\\(x86\\)", _MAKE.esc("Debug(x86)"))
|
||||
end
|
||||
|
||||
function suite.DoesNotEscape_ShellReplacements()
|
||||
test.isequal("-L$(NVSDKCUDA_ROOT)/C/lib", _MAKE.esc("-L$(NVSDKCUDA_ROOT)/C/lib"))
|
||||
end
|
||||
|
||||
function suite.CanEscape_ShellReplacementCapturesShortest()
|
||||
test.isequal("a\\(x\\)b$(ROOT)c\\(y\\)d", _MAKE.esc("a(x)b$(ROOT)c(y)d"))
|
||||
end
|
||||
|
126
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_make_linking.lua
vendored
Normal file
126
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_make_linking.lua
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
--
|
||||
-- tests/actions/make/test_make_linking.lua
|
||||
-- Validate library references in makefiles.
|
||||
-- Copyright (c) 2010-2013 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.gcc_linking = {}
|
||||
local suite = T.gcc_linking
|
||||
local cpp = premake.make.cpp
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
_OS = "linux"
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
cfg = premake.getconfig(prj, "Debug")
|
||||
cpp.linker(cfg, premake.gcc)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check linking to a shared library sibling project. In order to support
|
||||
-- custom target prefixes and extensions, use the full, relative path
|
||||
-- to the library.
|
||||
--
|
||||
|
||||
function suite.onSharedLibrarySibling()
|
||||
links { "MyProject2" }
|
||||
test.createproject(sln)
|
||||
kind "SharedLib"
|
||||
targetdir "libs"
|
||||
prepare()
|
||||
test.capture [[
|
||||
ALL_LDFLAGS += $(LDFLAGS) -Llibs -s
|
||||
LDDEPS += libs/libMyProject2.so
|
||||
LIBS += $(LDDEPS)
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check linking to a static library sibling project. As with shared
|
||||
-- libraries, it should list out the full relative path.
|
||||
--
|
||||
|
||||
function suite.onStaticLibrarySibling()
|
||||
links { "MyProject2" }
|
||||
test.createproject(sln)
|
||||
kind "StaticLib"
|
||||
targetdir "libs"
|
||||
prepare()
|
||||
test.capture [[
|
||||
ALL_LDFLAGS += $(LDFLAGS) -Llibs -s
|
||||
LDDEPS += libs/libMyProject2.a
|
||||
LIBS += $(LDDEPS)
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If an executable is listed in the links, no linking should happen (a
|
||||
-- build dependency would have been created at the solution level)
|
||||
--
|
||||
|
||||
function suite.onConsoleAppSibling()
|
||||
links { "MyProject2" }
|
||||
test.createproject(sln)
|
||||
kind "ConsoleApp"
|
||||
targetdir "libs"
|
||||
prepare()
|
||||
test.capture [[
|
||||
ALL_LDFLAGS += $(LDFLAGS) -s
|
||||
LDDEPS +=
|
||||
LIBS += $(LDDEPS)
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Make sure that project locations are taken into account when building
|
||||
-- the path to the library.
|
||||
--
|
||||
|
||||
|
||||
function suite.onProjectLocations()
|
||||
location "MyProject"
|
||||
links { "MyProject2" }
|
||||
|
||||
test.createproject(sln)
|
||||
kind "SharedLib"
|
||||
location "MyProject2"
|
||||
targetdir "MyProject2"
|
||||
|
||||
prepare()
|
||||
test.capture [[
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L../MyProject2 -s
|
||||
LDDEPS += ../MyProject2/libMyProject2.so
|
||||
LIBS += $(LDDEPS)
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- When referencing an external library via a path, the directory
|
||||
-- should be added to the library search paths, and the library
|
||||
-- itself included via an -l flag.
|
||||
--
|
||||
|
||||
function suite.onExternalLibraryWithPath()
|
||||
location "MyProject"
|
||||
links { "libs/SomeLib" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L../libs -s
|
||||
LDDEPS +=
|
||||
LIBS += $(LDDEPS) -lSomeLib
|
||||
]]
|
||||
end
|
120
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_make_pch.lua
vendored
Normal file
120
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_make_pch.lua
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
--
|
||||
-- tests/actions/make/test_make_pch.lua
|
||||
-- Validate the setup for precompiled headers in makefiles.
|
||||
-- Copyright (c) 2010 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.make_pch = { }
|
||||
local suite = T.make_pch
|
||||
local _ = premake.make.cpp
|
||||
|
||||
|
||||
--
|
||||
-- Setup and teardown
|
||||
--
|
||||
|
||||
local sln, prj, cfg
|
||||
function suite.setup()
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.getconfig(prj)
|
||||
cfg = premake.getconfig(prj, "Debug")
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Configuration block tests
|
||||
--
|
||||
|
||||
function suite.NoConfig_OnNoHeaderSet()
|
||||
prepare()
|
||||
_.pchconfig(cfg)
|
||||
test.capture [[]]
|
||||
end
|
||||
|
||||
|
||||
function suite.NoConfig_OnHeaderAndNoPCHFlag()
|
||||
pchheader "include/myproject.h"
|
||||
flags { NoPCH }
|
||||
prepare()
|
||||
_.pchconfig(cfg)
|
||||
test.capture [[]]
|
||||
end
|
||||
|
||||
|
||||
function suite.ConfigBlock_OnPchEnabled()
|
||||
pchheader "include/myproject.h"
|
||||
prepare()
|
||||
_.pchconfig(cfg)
|
||||
test.capture [[
|
||||
PCH = include/myproject.h
|
||||
GCH = $(OBJDIR)/$(notdir $(PCH)).gch
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Build rule tests
|
||||
--
|
||||
|
||||
function suite.BuildRules_OnCpp()
|
||||
pchheader "include/myproject.h"
|
||||
prepare()
|
||||
_.pchrules(prj)
|
||||
test.capture [[
|
||||
ifneq (,$(PCH))
|
||||
$(GCH): $(PCH)
|
||||
@echo $(notdir $<)
|
||||
$(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.BuildRules_OnC()
|
||||
language "C"
|
||||
pchheader "include/myproject.h"
|
||||
prepare()
|
||||
_.pchrules(prj)
|
||||
test.capture [[
|
||||
ifneq (,$(PCH))
|
||||
$(GCH): $(PCH)
|
||||
@echo $(notdir $<)
|
||||
$(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Ensure that PCH is included on all files that use it.
|
||||
--
|
||||
|
||||
function suite.includesPCH_onUse()
|
||||
pchheader "include/myproject.h"
|
||||
files { "main.cpp" }
|
||||
prepare()
|
||||
_.fileRules(prj)
|
||||
test.capture [[
|
||||
$(OBJDIR)/main.o: main.cpp
|
||||
@echo $(notdir $<)
|
||||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If the header is located on one of the include file
|
||||
-- search directories, it should get found automatically.
|
||||
--
|
||||
|
||||
function suite.findsPCH_onIncludeDirs()
|
||||
location "MyProject"
|
||||
pchheader "premake.h"
|
||||
includedirs { "../src/host" }
|
||||
prepare()
|
||||
_.pchconfig(cfg)
|
||||
test.capture [[
|
||||
PCH = ../../src/host/premake.h
|
||||
]]
|
||||
end
|
51
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_makesettings.lua
vendored
Normal file
51
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_makesettings.lua
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
--
|
||||
-- tests/actions/make/test_makesettings.lua
|
||||
-- Tests makesettings lists in generated makefiles.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.make_settings = { }
|
||||
local suite = T.make_settings
|
||||
local make = premake.make
|
||||
|
||||
local sln, prj, cfg
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "gmake"
|
||||
|
||||
sln = solution("MySolution")
|
||||
configurations { "Debug", "Release" }
|
||||
makesettings { "SOLUTION_LEVEL_SETTINGS" }
|
||||
|
||||
project("MyProject")
|
||||
makesettings { "PROJECT_LEVEL_SETTINGS" }
|
||||
|
||||
configuration { "Debug" }
|
||||
makesettings { "DEBUG_LEVEL_SETTINGS" }
|
||||
|
||||
configuration { "Release" }
|
||||
makesettings { "RELEASE_LEVEL_SETTINGS" }
|
||||
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
cfg = premake.getconfig(prj, "Debug")
|
||||
end
|
||||
|
||||
|
||||
function suite.writesProjectSettings()
|
||||
make.settings(prj, premake.gcc)
|
||||
test.capture [[
|
||||
SOLUTION_LEVEL_SETTINGS
|
||||
PROJECT_LEVEL_SETTINGS
|
||||
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.writesConfigSettings()
|
||||
make.settings(cfg, premake.gcc)
|
||||
test.capture [[
|
||||
DEBUG_LEVEL_SETTINGS
|
||||
|
||||
]]
|
||||
end
|
||||
|
62
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_wiidev.lua
vendored
Normal file
62
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/make/test_wiidev.lua
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
--
|
||||
-- tests/actions/make/test_wiidev.lua
|
||||
-- Tests for Wii homebrew support in makefiles.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.make_wiidev = { }
|
||||
local suite = T.make_wiidev
|
||||
local make = premake.make
|
||||
local cpp = premake.make.cpp
|
||||
|
||||
local sln, prj, cfg
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "gmake"
|
||||
|
||||
sln = solution("MySolution")
|
||||
configurations { "Debug", "Release" }
|
||||
platforms { "WiiDev" }
|
||||
|
||||
prj = project("MyProject")
|
||||
|
||||
premake.bake.buildconfigs()
|
||||
cfg = premake.getconfig(prj, "Debug", "WiiDev")
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Make sure that the Wii-specific flags are passed to the tools.
|
||||
--
|
||||
|
||||
function suite.writesCorrectFlags()
|
||||
cpp.flags(cfg, premake.gcc)
|
||||
test.capture [[
|
||||
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) -MP $(DEFINES) $(INCLUDES)
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)
|
||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
|
||||
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.writesCorrectLinkFlags()
|
||||
cpp.linker(cfg, premake.gcc)
|
||||
test.capture [[
|
||||
ALL_LDFLAGS += $(LDFLAGS) -s -L$(LIBOGC_LIB) $(MACHDEP)
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Make sure the dev kit include is written to each Wii build configuration.
|
||||
--
|
||||
|
||||
function suite.writesIncludeBlock()
|
||||
make.settings(cfg, premake.gcc)
|
||||
test.capture [[
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "DEVKITPPC environment variable is not set")'
|
||||
endif
|
||||
include $(DEVKITPPC)/wii_rules'
|
||||
]]
|
||||
end
|
197
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/test_clean.lua
vendored
Normal file
197
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/test_clean.lua
vendored
Normal file
@ -0,0 +1,197 @@
|
||||
--
|
||||
-- tests/actions/test_clean.lua
|
||||
-- Automated test suite for the "clean" action.
|
||||
-- Copyright (c) 2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.clean = { }
|
||||
|
||||
|
||||
--
|
||||
-- Replacement functions for remove() and rmdir() for testing
|
||||
--
|
||||
|
||||
local os_remove, os_rmdir, cwd
|
||||
local removed
|
||||
|
||||
local function test_remove(fn)
|
||||
if not cwd then cwd = os.getcwd() end
|
||||
table.insert(removed, path.getrelative(cwd, fn))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Setup/teardown
|
||||
--
|
||||
|
||||
local sln
|
||||
function T.clean.setup()
|
||||
_ACTION = "clean"
|
||||
|
||||
os_remove = os.remove
|
||||
os_rmdir = os.rmdir
|
||||
os.remove = test_remove
|
||||
os.rmdir = test_remove
|
||||
removed = {}
|
||||
|
||||
sln = solution "MySolution"
|
||||
configurations { "Debug", "Release" }
|
||||
end
|
||||
|
||||
function T.clean.teardown()
|
||||
os.remove = os_remove
|
||||
os.rmdir = os_rmdir
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
premake.action.call("clean")
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function T.clean.SolutionFiles()
|
||||
prepare()
|
||||
test.contains(removed, "MySolution.sln")
|
||||
test.contains(removed, "MySolution.suo")
|
||||
test.contains(removed, "MySolution.ncb")
|
||||
test.contains(removed, "MySolution.userprefs")
|
||||
test.contains(removed, "MySolution.usertasks")
|
||||
test.contains(removed, "MySolution.workspace")
|
||||
test.contains(removed, "MySolution_wsp.mk")
|
||||
test.contains(removed, "MySolution.tags")
|
||||
test.contains(removed, "Makefile")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CppProjectFiles()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject.vcproj")
|
||||
test.contains(removed, "MyProject.pdb")
|
||||
test.contains(removed, "MyProject.idb")
|
||||
test.contains(removed, "MyProject.ilk")
|
||||
test.contains(removed, "MyProject.cbp")
|
||||
test.contains(removed, "MyProject.depend")
|
||||
test.contains(removed, "MyProject.layout")
|
||||
test.contains(removed, "MyProject.mk")
|
||||
test.contains(removed, "MyProject.list")
|
||||
test.contains(removed, "MyProject.out")
|
||||
test.contains(removed, "MyProject.make")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CsProjectFiles()
|
||||
prj = project "MyProject"
|
||||
language "C#"
|
||||
kind "ConsoleApp"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject.csproj")
|
||||
test.contains(removed, "MyProject.csproj.user")
|
||||
test.contains(removed, "MyProject.pdb")
|
||||
test.contains(removed, "MyProject.idb")
|
||||
test.contains(removed, "MyProject.ilk")
|
||||
test.contains(removed, "MyProject.make")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.ObjectDirsAndFiles()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
prepare()
|
||||
test.contains(removed, "obj/Debug")
|
||||
test.contains(removed, "obj/Release")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CppConsoleAppFiles()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject")
|
||||
test.contains(removed, "MyProject.exe")
|
||||
test.contains(removed, "MyProject.elf")
|
||||
test.contains(removed, "MyProject.vshost.exe")
|
||||
test.contains(removed, "MyProject.exe.manifest")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CppWindowedAppFiles()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "WindowedApp"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject")
|
||||
test.contains(removed, "MyProject.exe")
|
||||
test.contains(removed, "MyProject.app")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CppSharedLibFiles()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "SharedLib"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject.dll")
|
||||
test.contains(removed, "libMyProject.so")
|
||||
test.contains(removed, "MyProject.lib")
|
||||
test.contains(removed, "libMyProject.dylib")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CppBundleFiles()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "Bundle"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject.dll")
|
||||
test.contains(removed, "libMyProject.so")
|
||||
test.contains(removed, "MyProject.lib")
|
||||
test.contains(removed, "MyProject.bundle")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CppStaticLibFiles()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "StaticLib"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject.lib")
|
||||
test.contains(removed, "libMyProject.a")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.PlatformObjects()
|
||||
platforms { "Native", "x32" }
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
prepare()
|
||||
test.contains(removed, "obj/Debug")
|
||||
test.contains(removed, "obj/Release")
|
||||
test.contains(removed, "obj/x32/Debug")
|
||||
test.contains(removed, "obj/x32/Release")
|
||||
end
|
||||
|
||||
|
||||
function T.clean.CppConsoleAppFiles_OnSuffix()
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
targetsuffix "_x"
|
||||
prepare()
|
||||
test.contains(removed, "MyProject_x")
|
||||
test.contains(removed, "MyProject_x.exe")
|
||||
test.contains(removed, "MyProject_x.elf")
|
||||
test.contains(removed, "MyProject_x.vshost.exe")
|
||||
test.contains(removed, "MyProject_x.exe.manifest")
|
||||
end
|
||||
|
141
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/cs2002/test_files.lua
vendored
Normal file
141
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/cs2002/test_files.lua
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
--
|
||||
-- tests/actions/vstudio/cs2002/test_files.lua
|
||||
-- Validate generation of <Files/> block in Visual Studio 2002 .csproj
|
||||
-- Copyright (c) 2009-2012 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_cs2002_files = { }
|
||||
local suite = T.vstudio_cs2002_files
|
||||
local cs2002 = premake.vstudio.cs2002
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
cs2002.Files(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test grouping and nesting
|
||||
--
|
||||
|
||||
function suite.SimpleSourceFile()
|
||||
files { "Hello.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelPath = "Hello.cs"
|
||||
BuildAction = "Compile"
|
||||
SubType = "Code"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.NestedSourceFile()
|
||||
files { "Src/Hello.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelPath = "Src\Hello.cs"
|
||||
BuildAction = "Compile"
|
||||
SubType = "Code"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- The relative path to the file is correct for files that live outside
|
||||
-- the project's folder.
|
||||
--
|
||||
|
||||
function suite.filesUseRelativePath_onOutOfTreePath()
|
||||
files { "../Src/Hello.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelPath = "..\Src\Hello.cs"
|
||||
BuildAction = "Compile"
|
||||
SubType = "Code"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Test file dependencies
|
||||
--
|
||||
|
||||
function suite.SimpleResourceDependency()
|
||||
files { "Resources.resx", "Resources.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelPath = "Resources.cs"
|
||||
BuildAction = "Compile"
|
||||
SubType = "Code"
|
||||
/>
|
||||
<File
|
||||
RelPath = "Resources.resx"
|
||||
BuildAction = "EmbeddedResource"
|
||||
DependentUpon = "Resources.cs"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test build actions
|
||||
--
|
||||
|
||||
function suite.BuildAction_Compile()
|
||||
files { "Hello.png" }
|
||||
configuration "*.png"
|
||||
buildaction "Compile"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelPath = "Hello.png"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.BuildAction_Copy()
|
||||
files { "Hello.png" }
|
||||
configuration "*.png"
|
||||
buildaction "Copy"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelPath = "Hello.png"
|
||||
BuildAction = "Content"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.BuildAction_Embed()
|
||||
files { "Hello.png" }
|
||||
configuration "*.png"
|
||||
buildaction "Embed"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelPath = "Hello.png"
|
||||
BuildAction = "EmbeddedResource"
|
||||
/>
|
||||
]]
|
||||
end
|
@ -0,0 +1,74 @@
|
||||
--
|
||||
-- tests/actions/vstudio/cs2005/projectelement.lua
|
||||
-- Validate generation of <Project/> element in Visual Studio 2005+ .csproj
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_cs2005_projectelement = { }
|
||||
local suite = T.vstudio_cs2005_projectelement
|
||||
local cs2005 = premake.vstudio.cs2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
cs2005.projectelement(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.On2005()
|
||||
_ACTION = "vs2005"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.On2008()
|
||||
_ACTION = "vs2008"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.On2010()
|
||||
_ACTION = "vs2010"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.On2012()
|
||||
_ACTION = "vs2012"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.On2013()
|
||||
_ACTION = "vs2013"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
]]
|
||||
end
|
@ -0,0 +1,139 @@
|
||||
--
|
||||
-- tests/actions/vstudio/cs2005/projectsettings.lua
|
||||
-- Validate generation of root <PropertyGroup/> in Visual Studio 2005+ .csproj
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_cs2005_projectsettings = { }
|
||||
local suite = T.vstudio_cs2005_projectsettings
|
||||
local cs2005 = premake.vstudio.cs2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
language "C#"
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
cs2005.projectsettings(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Version Tests
|
||||
--
|
||||
|
||||
function suite.OnVs2005()
|
||||
_ACTION = "vs2005"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MyProject</RootNamespace>
|
||||
<AssemblyName>MyProject</AssemblyName>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.OnVs2008()
|
||||
_ACTION = "vs2008"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MyProject</RootNamespace>
|
||||
<AssemblyName>MyProject</AssemblyName>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.OnVs2010()
|
||||
_ACTION = "vs2010"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MyProject</RootNamespace>
|
||||
<AssemblyName>MyProject</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile></TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.OnVs2012()
|
||||
_ACTION = "vs2012"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MyProject</RootNamespace>
|
||||
<AssemblyName>MyProject</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Framework Tests
|
||||
--
|
||||
|
||||
function suite.OnFrameworkVersion()
|
||||
_ACTION = "vs2005"
|
||||
framework "3.0"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MyProject</RootNamespace>
|
||||
<AssemblyName>MyProject</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
@ -0,0 +1,59 @@
|
||||
--
|
||||
-- tests/actions/vstudio/cs2005/propertygroup.lua
|
||||
-- Validate configuration <PropertyGroup/> elements in Visual Studio 2005+ .csproj
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_cs2005_propertygroup = { }
|
||||
local suite = T.vstudio_cs2005_propertygroup
|
||||
local cs2005 = premake.vstudio.cs2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj, cfg
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
language "C#"
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
cfg = premake.getconfig(prj, "Debug")
|
||||
cs2005.propertygroup(cfg)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Version Tests
|
||||
--
|
||||
|
||||
function suite.OnVs2005()
|
||||
_ACTION = "vs2005"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.OnVs2008()
|
||||
_ACTION = "vs2008"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.OnVs2010()
|
||||
_ACTION = "vs2010"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
]]
|
||||
end
|
@ -0,0 +1,83 @@
|
||||
--
|
||||
-- tests/actions/vstudio/cs2005/test_files.lua
|
||||
-- Validate generation of <Files/> block in Visual Studio 2005 .csproj
|
||||
-- Copyright (c) 2009-2012 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_cs2005_files = { }
|
||||
local suite = T.vstudio_cs2005_files
|
||||
local cs2005 = premake.vstudio.cs2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
cs2005.files(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test grouping and nesting
|
||||
--
|
||||
|
||||
function suite.SimpleSourceFile()
|
||||
files { "Hello.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Compile Include="Hello.cs" />
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.NestedSourceFile()
|
||||
files { "Src/Hello.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Compile Include="Src\Hello.cs" />
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- The relative path to the file is correct for files that live outside
|
||||
-- the project's folder.
|
||||
--
|
||||
|
||||
function suite.filesUseRelativePath_onOutOfTreePath()
|
||||
files { "../Src/Hello.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Compile Include="..\Src\Hello.cs" />
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test file dependencies
|
||||
--
|
||||
|
||||
function suite.SimpleResourceDependency()
|
||||
files { "Resources.resx", "Resources.Designer.cs" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Compile Include="Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Resources.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
]]
|
||||
end
|
@ -0,0 +1,58 @@
|
||||
--
|
||||
-- tests/actions/vstudio/sln2005/dependencies.lua
|
||||
-- Validate generation of Visual Studio 2005+ solution project dependencies.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_sln2005_dependencies = { }
|
||||
local suite = T.vstudio_sln2005_dependencies
|
||||
local sln2005 = premake.vstudio.sln2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj1, prj2
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "vs2005"
|
||||
sln, prj1 = test.createsolution()
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
prj2 = test.createproject(sln)
|
||||
uuid "2151E83B-997F-4A9D-955D-380157E88C31"
|
||||
links "MyProject"
|
||||
end
|
||||
|
||||
local function prepare(language)
|
||||
prj1.language = language
|
||||
prj2.language = language
|
||||
premake.bake.buildconfigs()
|
||||
prj1 = premake.solution.getproject(sln, 1)
|
||||
prj2 = premake.solution.getproject(sln, 2)
|
||||
sln2005.projectdependencies(prj2)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.On2005_Cpp()
|
||||
prepare("C++")
|
||||
test.capture [[
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AE61726D-187C-E440-BD07-2556188A6565} = {AE61726D-187C-E440-BD07-2556188A6565}
|
||||
EndProjectSection
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2005_Cs()
|
||||
prepare("C#")
|
||||
test.capture [[
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AE61726D-187C-E440-BD07-2556188A6565} = {AE61726D-187C-E440-BD07-2556188A6565}
|
||||
EndProjectSection
|
||||
]]
|
||||
end
|
79
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/header.lua
vendored
Normal file
79
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/header.lua
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
--
|
||||
-- tests/actions/vstudio/sln2005/header.lua
|
||||
-- Validate generation of Visual Studio 2005+ solution header.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_sln2005_header = { }
|
||||
local suite = T.vstudio_sln2005_header
|
||||
local sln2005 = premake.vstudio.sln2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
sln2005.header()
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.On2005()
|
||||
_ACTION = "vs2005"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2008()
|
||||
_ACTION = "vs2008"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2010()
|
||||
_ACTION = "vs2010"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2012()
|
||||
_ACTION = "vs2012"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2013()
|
||||
_ACTION = "vs2013"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
]]
|
||||
end
|
51
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/layout.lua
vendored
Normal file
51
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/layout.lua
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
--
|
||||
-- tests/actions/vstudio/sln2005/layout.lua
|
||||
-- Validate the overall layout of VS 2005-2010 solutions.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_sln2005_layout = { }
|
||||
local suite = T.vstudio_sln2005_layout
|
||||
local sln2005 = premake.vstudio.sln2005
|
||||
|
||||
|
||||
local sln
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "vs2005"
|
||||
sln = test.createsolution()
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
sln2005.generate(sln)
|
||||
end
|
||||
|
||||
|
||||
function suite.BasicLayout()
|
||||
prepare()
|
||||
test.capture ('\239\187\191' .. [[
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
]])
|
||||
end
|
135
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/platforms.lua
vendored
Normal file
135
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/platforms.lua
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
--
|
||||
-- tests/actions/vstudio/sln2005/platforms.lua
|
||||
-- Validate generation of Visual Studio 2005+ SolutionConfigurationPlatforms block.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_sln2005_platforms = { }
|
||||
local suite = T.vstudio_sln2005_platforms
|
||||
local sln2005 = premake.vstudio.sln2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare(language)
|
||||
prj.language = language
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
sln2005.platforms(sln)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- C/C++ Tests
|
||||
--
|
||||
|
||||
function suite.On2005_Cpp()
|
||||
_ACTION = "vs2005"
|
||||
prepare("C++")
|
||||
test.capture [[
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- C# Tests
|
||||
--
|
||||
|
||||
function suite.On2005_Cs()
|
||||
_ACTION = "vs2005"
|
||||
prepare("C#")
|
||||
test.capture [[
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2010_Cs()
|
||||
_ACTION = "vs2010"
|
||||
prepare("C#")
|
||||
test.capture [[
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Mixed language tests
|
||||
--
|
||||
|
||||
function suite.On2005_MixedLanguages()
|
||||
_ACTION = "vs2005"
|
||||
test.createproject(sln)
|
||||
prepare("C#")
|
||||
test.capture [[
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2010_MixedLanguages()
|
||||
_ACTION = "vs2010"
|
||||
test.createproject(sln)
|
||||
prepare("C#")
|
||||
test.capture [[
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test multiple platforms
|
||||
--
|
||||
|
||||
function suite.On2005_MixedPlatforms()
|
||||
_ACTION = "vs2005"
|
||||
platforms { "x32", "x64" }
|
||||
prepare("C++")
|
||||
test.capture [[
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
||||
|
@ -0,0 +1,99 @@
|
||||
--
|
||||
-- tests/actions/vstudio/sln2005/projectplatforms.lua
|
||||
-- Validate generation of Visual Studio 2005+ ProjectConfigurationPlatforms block.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_sln2005_projectplatforms = { }
|
||||
local suite = T.vstudio_sln2005_projectplatforms
|
||||
local sln2005 = premake.vstudio.sln2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln, prj = test.createsolution()
|
||||
uuid "C9135098-6047-8142-B10E-D27E7F73FCB3"
|
||||
end
|
||||
|
||||
local function prepare(language)
|
||||
prj.language = language
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
sln2005.project_platforms(sln)
|
||||
end
|
||||
|
||||
|
||||
function suite.ProjectPlatforms_OnMixedLanguages()
|
||||
_ACTION = "vs2005"
|
||||
test.createproject(sln)
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
prepare("C#")
|
||||
test.capture [[
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.ProjectPlatforms_OnMultiplePlatformsAndMixedModes()
|
||||
_ACTION = "vs2005"
|
||||
platforms { "x32", "x64" }
|
||||
test.createproject(sln)
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
prepare("C#")
|
||||
test.capture [[
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.Build.0 = Debug|x64
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.ActiveCfg = Release|x64
|
||||
{AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
]]
|
||||
end
|
67
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/projects.lua
vendored
Normal file
67
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/sln2005/projects.lua
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
--
|
||||
-- tests/actions/vstudio/sln2005/projects.lua
|
||||
-- Validate generation of Visual Studio 2005+ solution project entries.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_sln2005_projects = { }
|
||||
local suite = T.vstudio_sln2005_projects
|
||||
local sln2005 = premake.vstudio.sln2005
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "vs2005"
|
||||
sln = test.createsolution()
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln2005.project(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- C/C++ project reference tests
|
||||
--
|
||||
|
||||
function suite.On2005_CppProject()
|
||||
_ACTION = "vs2005"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
|
||||
EndProject
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.On2010_CppProject()
|
||||
_ACTION = "vs2010"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcxproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
|
||||
EndProject
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- C# project reference tests
|
||||
--
|
||||
|
||||
function suite.On2005_CsProject()
|
||||
_ACTION = "vs2005"
|
||||
language "C#"
|
||||
prepare()
|
||||
test.capture [[
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyProject", "MyProject.csproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
|
||||
EndProject
|
||||
]]
|
||||
end
|
687
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/test_vs200x_vcproj.lua
vendored
Normal file
687
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/test_vs200x_vcproj.lua
vendored
Normal file
@ -0,0 +1,687 @@
|
||||
--
|
||||
-- tests/test_vs200x_vcproj.lua
|
||||
-- Automated test suite for Visual Studio 2002-2008 C/C++ project generation.
|
||||
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vs200x_vcproj = { }
|
||||
local suite = T.vs200x_vcproj
|
||||
local vc200x = premake.vstudio.vc200x
|
||||
|
||||
|
||||
--
|
||||
-- Configure a solution for testing
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
function suite.setup()
|
||||
_ACTION = "vs2005"
|
||||
|
||||
sln = solution "MySolution"
|
||||
configurations { "Debug", "Release" }
|
||||
platforms {}
|
||||
|
||||
project "DotNetProject" -- to test handling of .NET platform in solution
|
||||
language "C#"
|
||||
kind "ConsoleApp"
|
||||
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
|
||||
local cfg = premake.getconfig(sln.projects[2])
|
||||
cfg.name = prj.name
|
||||
cfg.blocks = prj.blocks
|
||||
prj = cfg
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Make sure I've got the basic layout correct
|
||||
--
|
||||
|
||||
function suite.BasicLayout()
|
||||
prepare()
|
||||
vc200x.generate(prj)
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="MyProject"
|
||||
ProjectGUID="{AE61726D-187C-E440-BD07-2556188A6565}"
|
||||
RootNamespace="MyProject"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="."
|
||||
IntermediateDirectory="obj\Debug\MyProject"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\MyProject.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="1"
|
||||
EntryPointSymbol="mainCRTStartup"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="."
|
||||
IntermediateDirectory="obj\Release\MyProject"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\MyProject.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="1"
|
||||
EntryPointSymbol="mainCRTStartup"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test multiple platforms
|
||||
--
|
||||
|
||||
function suite.Platforms_OnMultiplePlatforms()
|
||||
platforms { "x32", "x64" }
|
||||
prepare()
|
||||
|
||||
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')
|
||||
test.istrue(result:find '<Configuration\r\n\t\t\tName="Debug|x64"\r\n')
|
||||
test.istrue(result:find '<Configuration\r\n\t\t\tName="Release|x64"\r\n')
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Test x64 handling
|
||||
--
|
||||
|
||||
function suite.PlatformsList_OnX64()
|
||||
platforms { "Native", "x64" }
|
||||
prepare()
|
||||
vc200x.Platforms(prj)
|
||||
test.capture [[
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Test Xbox360 handling
|
||||
--
|
||||
|
||||
function suite.PlatformsList_OnXbox360()
|
||||
platforms { "Native", "Xbox360" }
|
||||
prepare()
|
||||
vc200x.Platforms(prj)
|
||||
test.capture [[
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="Xbox 360"
|
||||
/>
|
||||
</Platforms>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.CompilerBlock_OnXbox360()
|
||||
platforms { "Xbox360" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug", "Xbox360"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLX360CompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test PS3 handling
|
||||
--
|
||||
|
||||
function suite.PlatformsList_OnPS3()
|
||||
platforms { "Native", "PS3" }
|
||||
prepare()
|
||||
vc200x.Platforms(prj)
|
||||
test.capture [[
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.CompilerBlock_OnPS3()
|
||||
platforms { "PS3" }
|
||||
flags { "Symbols" }
|
||||
includedirs { "include/pkg1", "include/pkg2" }
|
||||
defines { "DEFINE1", "DEFINE2" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool_PS3(premake.getconfig(prj, "Debug", "PS3"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
AdditionalOptions=""
|
||||
AdditionalIncludeDirectories="include\pkg1;include\pkg2"
|
||||
PreprocessorDefinitions="DEFINE1;DEFINE2"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="0"
|
||||
CompileAs="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.LinkerBlock_OnPS3ConsoleApp()
|
||||
platforms { "PS3" }
|
||||
prepare()
|
||||
vc200x.VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="-s"
|
||||
OutputFile="$(OutDir)\MyProject.elf"
|
||||
LinkIncremental="0"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateManifest="false"
|
||||
ProgramDatabaseFile=""
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.LinkerBlock_OnPS3StaticLib()
|
||||
platforms { "PS3" }
|
||||
kind "StaticLib"
|
||||
prepare()
|
||||
vc200x.VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions="-s"
|
||||
OutputFile="$(OutDir)\libMyProject.a"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.LinkerBlock_OnPS3SharedLink()
|
||||
platforms { "PS3" }
|
||||
links { "MyLibrary" }
|
||||
project "MyLibrary"
|
||||
language "C++"
|
||||
kind "SharedLib"
|
||||
prepare()
|
||||
vc200x.VCLinkerTool_PS3(premake.getconfig(prj, "Debug", "PS3"))
|
||||
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="-s"
|
||||
AdditionalDependencies="libMyLibrary.a"
|
||||
OutputFile="$(OutDir)\MyProject.elf"
|
||||
LinkIncremental="0"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateManifest="false"
|
||||
ProgramDatabaseFile=""
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test manifest file handling.
|
||||
--
|
||||
|
||||
function suite.VCManifestTool_OnNoManifests()
|
||||
files { "hello.c", "goodbye.c" }
|
||||
prepare()
|
||||
vc200x.VCManifestTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.VCManifestTool_OnNoManifests()
|
||||
files { "hello.c", "project1.manifest", "goodbye.c", "project2.manifest" }
|
||||
prepare()
|
||||
vc200x.VCManifestTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
AdditionalManifestFiles="project1.manifest;project2.manifest"
|
||||
/>
|
||||
]]
|
||||
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/MyProject"
|
||||
pchheader "include/common.h"
|
||||
pchsource "source/common.cpp"
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="include/common.h"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Floating point flag tests
|
||||
--
|
||||
|
||||
function suite.CompilerBlock_OnFpFast()
|
||||
flags { "FloatFast" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
FloatingPointModel="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.CompilerBlock_OnFpStrict()
|
||||
flags { "FloatStrict" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
FloatingPointModel="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- PDB file naming tests
|
||||
--
|
||||
|
||||
function suite.CompilerBlock_OnTargetName()
|
||||
targetname "foob"
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\foob.pdb"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Compilation option tests
|
||||
--
|
||||
|
||||
function suite.CompilerBlock_OnMinimalRebuild()
|
||||
flags { "Symbols", "EnableMinimalRebuild" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- RuntimeLibrary tests
|
||||
--
|
||||
|
||||
function suite.CompilerBlock_RuntimeLibrary_IsDebug_OnSymbolsNoOptimize()
|
||||
flags { "Symbols" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.CompilerBlock_RuntimeLibrary_IsRelease_OnOptimize()
|
||||
flags { "Symbols", "Optimize" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- C language support
|
||||
--
|
||||
|
||||
function suite.CompilerBlock_RuntimeLibrary_IsDebug_OnSymbolsNoOptimize()
|
||||
language "C"
|
||||
flags { "Symbols" }
|
||||
prepare()
|
||||
vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.noLinkIncrementalFlag_valueEqualsOne()
|
||||
flags { "NoIncrementalLink" }
|
||||
prepare()
|
||||
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
|
||||
local result = io.endcapture()
|
||||
test.string_contains(result,'LinkIncremental="1"')
|
||||
end
|
||||
|
||||
function suite.staticLib_platformX64_MachineX64SetInAdditionalOptions()
|
||||
local sln1 = solution "sol"
|
||||
configurations { "foo" }
|
||||
platforms {'x64'}
|
||||
|
||||
local prj1 = project "prj"
|
||||
language 'C++'
|
||||
kind 'StaticLib'
|
||||
|
||||
premake.bake.buildconfigs()
|
||||
sln1.vstudio_configs = premake.vstudio.buildconfigs(sln1)
|
||||
prj1= premake.getconfig(sln1.projects[1])
|
||||
vc200x.generate(prj1)
|
||||
local result = io.endcapture()
|
||||
test.string_contains(result,'AdditionalOptions="/MACHINE:X64"')
|
||||
end
|
||||
|
||||
function suite.staticLib_platformX32_MachineX86SetInAdditionalOptions()
|
||||
local sln1 = solution "sol"
|
||||
configurations { "foo" }
|
||||
platforms {'x32'}
|
||||
|
||||
local prj1 = project "prj"
|
||||
language 'C++'
|
||||
kind 'StaticLib'
|
||||
|
||||
premake.bake.buildconfigs()
|
||||
sln1.vstudio_configs = premake.vstudio.buildconfigs(sln1)
|
||||
prj1= premake.getconfig(sln1.projects[1])
|
||||
vc200x.generate(prj1)
|
||||
local result = io.endcapture()
|
||||
test.string_contains(result,'AdditionalOptions="/MACHINE:X86"')
|
||||
end
|
@ -0,0 +1,116 @@
|
||||
--
|
||||
-- tests/actions/vstudio/test_vs200x_vcproj_linker.lua
|
||||
-- Automated tests for Visual Studio 2002-2008 C/C++ linker block.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vs200x_vcproj_linker = { }
|
||||
local suite = T.vs200x_vcproj_linker
|
||||
local vc200x = premake.vstudio.vc200x
|
||||
|
||||
|
||||
--
|
||||
-- Setup/Teardown
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
function suite.setup()
|
||||
_ACTION = "vs2005"
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test default linker blocks for each target kind
|
||||
-- (ConsoleApp, StaticLib, etc.)
|
||||
--
|
||||
|
||||
function suite.DefaultLinkerBlock_OnConsoleApp()
|
||||
kind "ConsoleApp"
|
||||
prepare()
|
||||
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\MyProject.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="1"
|
||||
EntryPointSymbol="mainCRTStartup"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.DefaultLinkerBlock_OnWindowedApp()
|
||||
kind "WindowedApp"
|
||||
prepare()
|
||||
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\MyProject.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="2"
|
||||
EntryPointSymbol="mainCRTStartup"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.DefaultLinkerBlock_OnSharedLib()
|
||||
kind "SharedLib"
|
||||
prepare()
|
||||
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\MyProject.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="2"
|
||||
ImportLibrary="MyProject.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.DefaultLinkerBlock_OnStaticLib()
|
||||
kind "StaticLib"
|
||||
prepare()
|
||||
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\MyProject.lib"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- linkoptions tests
|
||||
--
|
||||
|
||||
function suite.AdditionalOptions_OnStaticLib()
|
||||
kind "StaticLib"
|
||||
linkoptions { "/ltcg", "/lZ" }
|
||||
prepare()
|
||||
vc200x.VCLinkerTool(premake.getconfig(prj, "Debug"))
|
||||
test.capture [[
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\MyProject.lib"
|
||||
AdditionalOptions="/ltcg /lZ"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
363
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/test_vs2010_flags.lua
vendored
Normal file
363
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/test_vs2010_flags.lua
vendored
Normal file
@ -0,0 +1,363 @@
|
||||
|
||||
T.vs2010_flags = { }
|
||||
local vs10_flags = T.vs2010_flags
|
||||
local sln, prj
|
||||
|
||||
function vs10_flags.setup()
|
||||
_ACTION = "vs2010"
|
||||
|
||||
sln = solution "MySolution"
|
||||
configurations { "Debug" }
|
||||
platforms {}
|
||||
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
includedirs{"foo/bar"}
|
||||
end
|
||||
|
||||
function vs10_flags.teardown()
|
||||
sln = nil
|
||||
prj = nil
|
||||
end
|
||||
|
||||
local function get_buffer()
|
||||
io.capture()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
premake.vs2010_vcxproj(prj)
|
||||
local buffer = io.endcapture()
|
||||
return buffer
|
||||
end
|
||||
|
||||
|
||||
function vs10_flags.sseSet()
|
||||
flags {"EnableSSE"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')
|
||||
end
|
||||
|
||||
function vs10_flags.sse2Set()
|
||||
flags {"EnableSSE2"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')
|
||||
end
|
||||
|
||||
function vs10_flags.extraWarningNotSet_warningLevelIsThree()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<WarningLevel>Level3</WarningLevel>')
|
||||
end
|
||||
|
||||
function vs10_flags.extraWarning_warningLevelIsFour()
|
||||
flags {"ExtraWarnings"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<WarningLevel>Level4</WarningLevel>')
|
||||
end
|
||||
|
||||
function vs10_flags.extraWarning_treatWarningsAsError_setToTrue()
|
||||
flags {"FatalWarnings"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<TreatWarningAsError>true</TreatWarningAsError>')
|
||||
end
|
||||
|
||||
function vs10_flags.floatFast_floatingPointModel_setToFast()
|
||||
flags {"FloatFast"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<FloatingPointModel>Fast</FloatingPointModel>')
|
||||
end
|
||||
|
||||
function vs10_flags.floatStrict_floatingPointModel_setToStrict()
|
||||
flags {"FloatStrict"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<FloatingPointModel>Strict</FloatingPointModel>')
|
||||
end
|
||||
|
||||
function vs10_flags.nativeWideChar_TreatWChar_tAsBuiltInType_setToTrue()
|
||||
flags {"NativeWChar"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')
|
||||
end
|
||||
|
||||
function vs10_flags.nativeWideChar_TreatWChar_tAsBuiltInType_setToFalse()
|
||||
flags {"NoNativeWChar"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')
|
||||
end
|
||||
|
||||
function vs10_flags.noExceptions_exceptionHandling_setToFalse()
|
||||
flags {"NoExceptions"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ExceptionHandling>false</ExceptionHandling>')
|
||||
end
|
||||
|
||||
function vs10_flags.structuredExceptions_exceptionHandling_setToAsync()
|
||||
flags {"SEH"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ExceptionHandling>Async</ExceptionHandling>')
|
||||
end
|
||||
|
||||
function vs10_flags.noFramePointer_omitFramePointers_setToTrue()
|
||||
flags {"NoFramePointer"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<OmitFramePointers>true</OmitFramePointers>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_flags.noRTTI_runtimeTypeInfo_setToFalse()
|
||||
flags {"NoRTTI"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')
|
||||
end
|
||||
|
||||
function vs10_flags.callingconvention_fastcall()
|
||||
flags {"FastCall"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<CallingConvention>FastCall</CallingConvention>')
|
||||
end
|
||||
|
||||
function vs10_flags.callingconvention_stdcall()
|
||||
flags {"StdCall"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<CallingConvention>StdCall</CallingConvention>')
|
||||
end
|
||||
|
||||
function vs10_flags.optimizeSize_optimization_setToMinSpace()
|
||||
flags {"OptimizeSize"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Optimization>MinSpace</Optimization>')
|
||||
end
|
||||
|
||||
function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed()
|
||||
flags {"OptimizeSpeed"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Optimization>MaxSpeed</Optimization>')
|
||||
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 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.debugAndMinimalRebuildAndSymbols_minimalRebuild_setToFalse()
|
||||
flags {debug_string,"EnableMinimalRebuild"}
|
||||
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<MinimalRebuild>true</MinimalRebuild>')
|
||||
end
|
||||
|
||||
function vs10_flags.debugYetNotMinimalRebuild_minimalRebuild_setToTrue()
|
||||
flags {debug_string}
|
||||
|
||||
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
|
||||
|
||||
--there is not an option for /Z7 OldStyle
|
||||
--/ZI is not compatible with /clr or x64_64
|
||||
--minimal Rebuild requires /Zi in x86_64
|
||||
|
||||
function vs10_flags.symbols_32BitBuild_DebugInformationFormat_setToEditAndContinue()
|
||||
flags{"Symbols"}
|
||||
platforms{'x32'}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<DebugInformationFormat>EditAndContinue</DebugInformationFormat>')
|
||||
end
|
||||
|
||||
function vs10_flags.symbols_64BitBuild_DebugInformationFormat_setToProgramDatabase()
|
||||
flags{"Symbols"}
|
||||
platforms{"x64"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<DebugInformationFormat>ProgramDatabase</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.symbolsManaged_DebugInformationFormat_setToProgramDatabase()
|
||||
flags{"Symbols","Managed"}
|
||||
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.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,'<ClCompile>.*<ProgramDataBaseFileName>%$%(OutDir%)MyProject%.pdb</ProgramDataBaseFileName>.*</ClCompile>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_flags.WithOutManaged_bufferContainsKeywordWin32Proj()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup Label="Globals">.*<Keyword>Win32Proj</Keyword>.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
function vs10_flags.WithOutManaged_bufferDoesNotContainKeywordManagedCProj()
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,'<PropertyGroup Label="Globals">.*<Keyword>ManagedCProj</Keyword>.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
T.vs2010_managedFlag = { }
|
||||
local vs10_managedFlag = T.vs2010_managedFlag
|
||||
|
||||
local function vs10_managedFlag_setOnProject()
|
||||
local sln = solution "Sol"
|
||||
configurations { "Debug" }
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
|
||||
local prj = project "Prj"
|
||||
flags {"Managed"}
|
||||
|
||||
return sln,prj
|
||||
end
|
||||
|
||||
|
||||
local function get_managed_buffer(sln,prj)
|
||||
io.capture()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
premake.vs2010_vcxproj(prj)
|
||||
local buffer = io.endcapture()
|
||||
return buffer
|
||||
end
|
||||
|
||||
function vs10_managedFlag.setup()
|
||||
end
|
||||
|
||||
function vs10_managedFlag.managedSetOnProject_CLRSupport_setToTrue()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
|
||||
test.string_contains(buffer,
|
||||
'<PropertyGroup Condition=".*" Label="Configuration">'
|
||||
..'.*<CLRSupport>true</CLRSupport>'
|
||||
..'.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
function vs10_managedFlag.globals_bufferContainsKeywordManagedCProj()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_contains(buffer,'<PropertyGroup Label="Globals">.*<Keyword>ManagedCProj</Keyword>.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_managedFlag.globals_bufferDoesNotContainKeywordWin32Proj()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_does_not_contain(buffer,'<PropertyGroup Label="Globals">.*<Keyword>Win32Proj</Keyword>.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_managedFlag.globals_FrameworkVersion_setToV4()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_contains(buffer,'<PropertyGroup Label="Globals">.*<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_managedFlag.withFloatFast_FloatingPointModelNotFoundInBuffer()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
flags {"FloatStrict"}
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_does_not_contain(buffer,'<FloatingPointModel>.*</FloatingPointModel>')
|
||||
end
|
||||
|
||||
function vs10_managedFlag.debugWithStaticRuntime_flagIgnoredAndRuntimeSetToMDd()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
flags {"Symbols","StaticRuntime"}
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>')
|
||||
end
|
||||
|
||||
function vs10_managedFlag.notDebugWithStaticRuntime_flagIgnoredAndRuntimeSetToMD()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
flags {"StaticRuntime"}
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_contains(buffer,'<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>')
|
||||
end
|
||||
|
||||
function vs10_managedFlag.noOptimisationFlag_basicRuntimeChecksNotFoundInBuffer()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_does_not_contain(buffer,'<BasicRuntimeChecks>.*</BasicRuntimeChecks>')
|
||||
end
|
||||
|
||||
function vs10_managedFlag.applictionWithOutWinMain_EntryPointSymbolNotFoundInBuffer()
|
||||
local sln, prj = vs10_managedFlag_setOnProject()
|
||||
local buffer = get_managed_buffer(sln,prj)
|
||||
test.string_does_not_contain(buffer,'<EntryPointSymbol>.*</EntryPointSymbol>')
|
||||
end
|
@ -0,0 +1,166 @@
|
||||
T.vs2010_project_kinds= { }
|
||||
local vs10_project_kinds = T.vs2010_project_kinds
|
||||
local sln, prj
|
||||
|
||||
function vs10_project_kinds.setup()
|
||||
_ACTION = "vs2010"
|
||||
|
||||
sln = solution "MySolution"
|
||||
configurations { "Debug" }
|
||||
platforms {}
|
||||
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
end
|
||||
|
||||
local function get_buffer(platform)
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
premake.vs2010_vcxproj(prj)
|
||||
buffer = io.endcapture()
|
||||
return buffer
|
||||
end
|
||||
|
||||
|
||||
function vs10_project_kinds.staticLib_containsLibSection()
|
||||
kind "StaticLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ItemDefinitionGroup.*<Lib>.*</Lib>.*</ItemDefinitionGroup>')
|
||||
end
|
||||
function vs10_project_kinds.staticLib_libSection_containsProjectNameDotLib()
|
||||
kind "StaticLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Lib>.*<OutputFile>.*MyProject.lib.*</OutputFile>.*</Lib>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_project_kinds.staticLib_valueInMinimalRebuildIsTrue()
|
||||
kind "StaticLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ClCompile>.*<MinimalRebuild>true</MinimalRebuild>.*</ClCompile>')
|
||||
end
|
||||
function vs10_project_kinds.sharedLib_valueInMinimalRebuildIsTrue()
|
||||
kind "SharedLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ClCompile>.*<MinimalRebuild>true</MinimalRebuild>.*</ClCompile>')
|
||||
end
|
||||
function vs10_project_kinds.sharedLib_valueDebugInformationFormatIsEditAndContinue()
|
||||
kind "SharedLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ClCompile>.*<DebugInformationFormat>EditAndContinue</DebugInformationFormat>.*</ClCompile>')
|
||||
end
|
||||
function vs10_project_kinds.sharedLib_valueGenerateDebugInformationIsTrue()
|
||||
kind "SharedLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Link>.*<GenerateDebugInformation>true</GenerateDebugInformation>.*</Link>')
|
||||
end
|
||||
function vs10_project_kinds.sharedLib_linkSectionContainsImportLibrary()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Link>.*<ImportLibrary>.*</ImportLibrary>.*</Link>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withoutOptimisation_linkIncrementalValueIsTrue()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<LinkIncremental.*true</LinkIncremental>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withOptimisation_linkIncrementalValueIsFalse()
|
||||
kind "SharedLib"
|
||||
flags{"Optimize"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<LinkIncremental.*false</LinkIncremental>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.kindDoesNotMatter_noAdditionalDirectoriesSpecified_bufferDoesNotContainAdditionalIncludeDirectories()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,'<ClCompile>.*<AdditionalIncludeDirectories>.*</ClCompile>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.configType_configIsWindowedApp_resultComparesEqualToApplication()
|
||||
local t = { kind = "WindowedApp"}
|
||||
local result = premake.vstudio.vc2010.config_type(t)
|
||||
test.isequal('Application',result)
|
||||
end
|
||||
|
||||
function vs10_project_kinds.linkOptions_staticLib_bufferContainsAdditionalOptionsInSideLibTag()
|
||||
kind "StaticLib"
|
||||
linkoptions{'/dummyOption'}
|
||||
|
||||
test.string_contains(get_buffer(),
|
||||
'<AdditionalOptions>.*%%%(AdditionalOptions%)</AdditionalOptions>.*</Lib>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.noLinkOptions_staticLib_bufferDoesNotContainAdditionalOptionsInSideLibTag()
|
||||
kind "StaticLib"
|
||||
|
||||
test.string_does_not_contain(get_buffer(),
|
||||
'<AdditionalOptions>.*%%%(AdditionalOptions%)</AdditionalOptions>.*</Lib>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.linkOptions_staticLib_bufferContainsPassedOption()
|
||||
kind "StaticLib"
|
||||
linkoptions{'/dummyOption'}
|
||||
|
||||
test.string_contains(get_buffer(),
|
||||
'<AdditionalOptions>/dummyOption %%%(AdditionalOptions%)</AdditionalOptions>.*</Lib>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.linkOptions_windowedApp_bufferContainsAdditionalOptionsInSideLinkTag()
|
||||
kind "WindowedApp"
|
||||
linkoptions{'/dummyOption'}
|
||||
|
||||
test.string_contains(get_buffer(),
|
||||
'<AdditionalOptions>.* %%%(AdditionalOptions%)</AdditionalOptions>.*</Link>')
|
||||
end
|
||||
function vs10_project_kinds.linkOptions_consoleApp_bufferContainsAdditionalOptionsInSideLinkTag()
|
||||
kind "ConsoleApp"
|
||||
linkoptions{'/dummyOption'}
|
||||
|
||||
test.string_contains(get_buffer(),
|
||||
'<AdditionalOptions>.* %%%(AdditionalOptions%)</AdditionalOptions>.*</Link>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.linkOptions_sharedLib_bufferContainsAdditionalOptionsInSideLinkTag()
|
||||
kind "SharedLib"
|
||||
linkoptions{'/dummyOption'}
|
||||
|
||||
test.string_contains(get_buffer(),
|
||||
'<AdditionalOptions>.* %%%(AdditionalOptions%)</AdditionalOptions>.*</Link>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_project_kinds.staticLibX64_TargetMachineSetInLib()
|
||||
kind "StaticLib"
|
||||
platforms{'x64'}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Lib>.*<TargetMachine>.*</TargetMachine>.*</Lib>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.staticLibX64_TargetMachineInLibSetToMachineX64()
|
||||
kind "StaticLib"
|
||||
platforms{'x64'}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Lib>.*<TargetMachine>MachineX64</TargetMachine>.*</Lib>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.staticLibX32_TargetMachineSetInLib()
|
||||
kind "StaticLib"
|
||||
platforms{'x32'}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Lib>.*<TargetMachine>.*</TargetMachine>.*</Lib>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.staticLibX32_TargetMachineInLibSetToMachineX86()
|
||||
kind "StaticLib"
|
||||
platforms{'x32'}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Lib>.*<TargetMachine>MachineX86</TargetMachine>.*</Lib>')
|
||||
end
|
289
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/test_vs2010_vcxproj.lua
vendored
Normal file
289
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/test_vs2010_vcxproj.lua
vendored
Normal file
@ -0,0 +1,289 @@
|
||||
T.vs2010_vcxproj = { }
|
||||
local vs10_vcxproj = T.vs2010_vcxproj
|
||||
local include_directory = "bar/foo"
|
||||
local include_directory2 = "baz/foo"
|
||||
local debug_define = "I_AM_ALIVE_NUMBER_FIVE"
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
local sln, prj
|
||||
function vs10_vcxproj.teardown()
|
||||
sln = nil
|
||||
prj = nil
|
||||
end
|
||||
function vs10_vcxproj.setup()
|
||||
_ACTION = "vs2010"
|
||||
|
||||
sln = solution "MySolution"
|
||||
configurations { "Debug", "Release" }
|
||||
platforms {}
|
||||
|
||||
prj = project "MyProject"
|
||||
language "C++"
|
||||
kind "ConsoleApp"
|
||||
uuid "AE61726D-187C-E440-BD07-2556188A6565"
|
||||
|
||||
includedirs
|
||||
{
|
||||
include_directory,
|
||||
include_directory2
|
||||
}
|
||||
files
|
||||
{
|
||||
"foo/dummyHeader.h",
|
||||
"foo/dummySource.cpp",
|
||||
"../src/host/*h",
|
||||
"../src/host/*.c",
|
||||
"dummyResourceScript.rc"
|
||||
}
|
||||
|
||||
configuration("Release")
|
||||
flags {"Optimize"}
|
||||
links{"foo","bar"}
|
||||
|
||||
configuration("Debug")
|
||||
defines {debug_define}
|
||||
links{"foo_d"}
|
||||
|
||||
end
|
||||
|
||||
local function get_buffer()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
premake.vs2010_vcxproj(prj)
|
||||
local buffer = io.endcapture()
|
||||
return buffer
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function vs10_vcxproj.xmlDeclarationPresent()
|
||||
local buffer = get_buffer()
|
||||
test.istrue(string.startswith(buffer, '<?xml version=\"1.0\" encoding=\"utf-8\"?>'))
|
||||
end
|
||||
|
||||
function vs10_vcxproj.projectBlocksArePresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Project.*</Project>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.projectOpenTagIsCorrect()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">.*</Project>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.configItemGroupPresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ItemGroup Label="ProjectConfigurations">.*</ItemGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.configBlocksArePresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ProjectConfiguration.*</ProjectConfiguration>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.configTypeBlockPresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup Condition="\'%$%(Configuration%)|%$%(Platform%)\'==\'.*\'" Label="Configuration">.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.twoConfigTypeBlocksPresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup Condition.*</PropertyGroup>.*<PropertyGroup Condition=.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.propsDefaultForCppProjArePresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Import Project="$%(VCTargetsPath%)\\Microsoft.Cpp.Default.props" />')
|
||||
end
|
||||
|
||||
|
||||
function vs10_vcxproj.propsForCppProjArePresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Import Project="%$%(VCTargetsPath%)\\Microsoft.Cpp.props" />')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.extensionSettingArePresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ImportGroup Label="ExtensionSettings">.*</ImportGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.userMacrosPresent()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup Label="UserMacros" />')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.projectWithDebugAndReleaseConfig_twoOutDirsAndTwoIntDirs()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<OutDir.*</OutDir>.*<IntDir.*</IntDir>.*<OutDir.*</OutDir>.*<IntDir.*</IntDir>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.containsItemDefinition()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ItemDefinitionGroup Condition="\'%$%(Configuration%)|%$%(Platform%)\'==\'.*\'">.*</ItemDefinitionGroup>')
|
||||
end
|
||||
|
||||
|
||||
function vs10_vcxproj.containsClCompileBlock()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ClCompile>.*</ClCompile>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.containsAdditionalOptions()
|
||||
buildoptions {"/Gm"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<AdditionalOptions>/Gm %%%(AdditionalOptions%)</AdditionalOptions>')
|
||||
end
|
||||
|
||||
local function cl_compile_string(version)
|
||||
return '<ItemDefinitionGroup Condition="\'%$%(Configuration%)|%$%(Platform%)\'==\''..version..'|Win32\'">.*<ClCompile>'
|
||||
end
|
||||
|
||||
function vs10_vcxproj.debugHasNoOptimisation()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer, cl_compile_string('Debug').. '.*<Optimization>Disabled</Optimization>.*</ItemDefinitionGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.releaseHasFullOptimisation()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer, cl_compile_string('Release').. '.*<Optimization>Full</Optimization>.*</ItemDefinitionGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,cl_compile_string('Debug').. '.*<AdditionalIncludeDirectories>'.. path.translate(include_directory, '\\') ..'.*</AdditionalIncludeDirectories>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory2PrefixWithSemiColon()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,cl_compile_string('Debug').. '.*<AdditionalIncludeDirectories>.*;'.. path.translate(include_directory2, '\\') ..'.*</AdditionalIncludeDirectories>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory2PostfixWithSemiColon()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,cl_compile_string('Debug').. '.*<AdditionalIncludeDirectories>.*'.. path.translate(include_directory2, '\\') ..';.*</AdditionalIncludeDirectories>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.debugContainsPreprossorBlock()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,cl_compile_string('Debug').. '.*<PreprocessorDefinitions>.*</PreprocessorDefinitions>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.debugHasDebugDefine()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,cl_compile_string('Debug')..'.*<PreprocessorDefinitions>.*'..debug_define..'.*</PreprocessorDefinitions>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.releaseHasStringPoolingOn()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,cl_compile_string('Release')..'.*<StringPooling>true</StringPooling>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.hasItemGroupSection()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ItemGroup>.*</ItemGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.itemGroupSection_hasResourceCompileSection()
|
||||
--for some reason this does not work here and it needs to be in
|
||||
--the project setting at the top ?
|
||||
--files{"dummyResourceScript.rc"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ItemGroup>.*<ResourceCompile.*</ItemGroup>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.checkProjectConfigurationOpeningTag_hasACloseingAngleBracket()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ProjectConfiguration Include="Debug|Win32">')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.postBuildEvent_isPresent()
|
||||
postbuildcommands { "doSomeThing" }
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PostBuildEvent>.*<Command>.*</Command>.*</PostBuildEvent>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.postBuildEvent_containsCorrectInformationBetweenCommandTag()
|
||||
postbuildcommands { "doSomeThing" }
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PostBuildEvent>.*<Command>doSomeThing</Command>.*</PostBuildEvent>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.postBuildEvent_eventEncloseByQuotes_containsCorrectInformationBetweenCommandTag()
|
||||
postbuildcommands { "\"doSomeThing\"" }
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PostBuildEvent>.*<Command>"doSomeThing"</Command>.*</PostBuildEvent>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.noExtraWarnings_bufferDoesNotContainSmallerTypeCheck()
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,'<SmallerTypeCheck>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.debugAndExtraWarnings_bufferContainsSmallerTypeCheck()
|
||||
configuration("Debug")
|
||||
flags {"ExtraWarnings"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<SmallerTypeCheck>true</SmallerTypeCheck>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.releaseAndExtraWarnings_bufferDoesNotContainSmallerTypeCheck()
|
||||
configuration("Release")
|
||||
flags {"ExtraWarnings"}
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,'<SmallerTypeCheck>')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.onlyOneProjectConfigurationBlockWhenMultipleConfigs()
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,'<ItemGroup Label="ProjectConfigurations">.*<ItemGroup Label="ProjectConfigurations">')
|
||||
end
|
||||
|
||||
function vs10_vcxproj.languageC_bufferContainsCompileAsC()
|
||||
language "C"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<CompileAs>CompileAsC</CompileAs>')
|
||||
end
|
||||
|
||||
local debug_config_pch_string = '<PrecompiledHeader Condition="\'%$%(Configuration%)|%$%(Platform%)\'==\'Debug|Win32\'">Create</PrecompiledHeader>'
|
||||
local release_config_pch_string = debug_config_pch_string:gsub('Debug','Release')
|
||||
|
||||
function vs10_vcxproj.noPchFlagSet_bufferDoesNotContainPchCreate()
|
||||
configuration("Debug")
|
||||
flags{"NoPCH"}
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,debug_config_pch_string)
|
||||
end
|
||||
|
||||
function vs10_vcxproj.pchHeaderSetYetPchSourceIsNot_bufferDoesNotContainPchCreate()
|
||||
configuration("Debug")
|
||||
pchheader "foo/dummyHeader.h"
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,debug_config_pch_string)
|
||||
end
|
||||
|
||||
function vs10_vcxproj.pchHeaderAndSourceSet_yetAlsoNoPch_bufferDoesNotContainpchCreate()
|
||||
configuration('Debug')
|
||||
pchheader "foo/dummyHeader.h"
|
||||
pchsource "foo/dummySource.cpp"
|
||||
flags{"NoPCH"}
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,debug_config_pch_string)
|
||||
end
|
||||
|
||||
function vs10_vcxproj.pchHeaderAndPchSourceSet_bufferContainPchCreate()
|
||||
configuration("Debug")
|
||||
pchheader "foo/dummyHeader.h"
|
||||
pchsource "foo/dummySource.cpp"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,debug_config_pch_string)
|
||||
end
|
||||
|
||||
function vs10_vcxproj.wholeProgramOptimizationIsNotSetByDefault_bufferDoesNotContainWholeProgramOptimization()
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,"WholeProgramOptimization")
|
||||
end
|
88
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc200x/debugdir.lua
vendored
Normal file
88
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc200x/debugdir.lua
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc200x/debugdir.lua
|
||||
-- Validate handling of the working directory for debugging.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs200x_debugdir = { }
|
||||
local suite = T.vstudio_vs200x_debugdir
|
||||
local vc200x = premake.vstudio.vc200x
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
vc200x.debugdir(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.EmptyBlock_OnNoDebugSettings()
|
||||
prepare()
|
||||
test.capture [[
|
||||
<DebugSettings
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.WorkingDirectory_OnRelativePath()
|
||||
debugdir "bin/debug"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<DebugSettings
|
||||
WorkingDirectory="bin\debug"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.Arguments()
|
||||
debugargs { "arg1", "arg2" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<DebugSettings
|
||||
CommandArguments="arg1 arg2"
|
||||
/>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
T.vc200x_env_args = { }
|
||||
local vs200x_env_args = T.vc200x_env_args
|
||||
|
||||
function vs200x_env_args.environmentArgs_notSet_bufferDoesNotContainEnvironment()
|
||||
vc200x.environmentargs( {flags={}} )
|
||||
test.string_does_not_contain(io.endcapture(),'Environment=')
|
||||
end
|
||||
function vs200x_env_args.environmentArgs_set_bufferContainsEnvironment()
|
||||
vc200x.environmentargs( {flags={},environmentargs={'key=value'}} )
|
||||
test.string_contains(io.endcapture(),'Environment=')
|
||||
end
|
||||
|
||||
function vs200x_env_args.environmentArgs_valueUsesQuotes_quotesMarksReplaced()
|
||||
vc200x.environmentargs( {flags={},environmentargs={'key="value"'}} )
|
||||
test.string_contains(io.endcapture(),'Environment="key="value""')
|
||||
end
|
||||
|
||||
function vs200x_env_args.environmentArgs_multipleArgs_seperatedUsingCorrectEscape()
|
||||
vc200x.environmentargs( {flags={},environmentargs={'key=value','foo=bar'}} )
|
||||
test.string_contains(io.endcapture(),'Environment="key=value
foo=bar"')
|
||||
end
|
||||
|
||||
function vs200x_env_args.environmentArgs_withDontMergeFlag_EnvironmentArgsDontMergeEqualsFalse()
|
||||
vc200x.environmentargs( {flags={EnvironmentArgsDontMerge=1},environmentargs={'key=value'}} )
|
||||
test.string_contains(io.endcapture(),'EnvironmentMerge="false"')
|
||||
end
|
43
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc200x/header.lua
vendored
Normal file
43
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc200x/header.lua
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc200x/header.lua
|
||||
-- Validate generation of the project file header block.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs200x_header = { }
|
||||
local suite = T.vstudio_vs200x_header
|
||||
local vc200x = premake.vstudio.vc200x
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
vc200x.header('VisualStudioProject')
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.On2008()
|
||||
_ACTION = 'vs2008'
|
||||
prepare()
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
]]
|
||||
end
|
222
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc200x/test_files.lua
vendored
Normal file
222
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc200x/test_files.lua
vendored
Normal file
@ -0,0 +1,222 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc200x/test_files.lua
|
||||
-- Validate generation of <files/> block in Visual Studio 200x projects.
|
||||
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs200x_files = { }
|
||||
local suite = T.vstudio_vs200x_files
|
||||
local vc200x = premake.vstudio.vc200x
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
vc200x.Files(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test grouping and nesting
|
||||
--
|
||||
|
||||
function suite.SimpleSourceFile()
|
||||
files { "hello.cpp" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelativePath="hello.cpp"
|
||||
>
|
||||
</File>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.SingleFolderLevel()
|
||||
files { "src/hello.cpp" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Filter
|
||||
Name="src"
|
||||
Filter=""
|
||||
>
|
||||
<File
|
||||
RelativePath="src\hello.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.MultipleFolderLevels()
|
||||
files { "src/greetings/hello.cpp" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Filter
|
||||
Name="src"
|
||||
Filter=""
|
||||
>
|
||||
<Filter
|
||||
Name="greetings"
|
||||
Filter=""
|
||||
>
|
||||
<File
|
||||
RelativePath="src\greetings\hello.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Non-source code files, such as header files and documentation, should
|
||||
-- be marked as such, so the compiler won't attempt to build them.
|
||||
--
|
||||
|
||||
function suite.file_markedAsNonBuildable_onSupportFiles()
|
||||
language "c"
|
||||
files { "hello.lua" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelativePath="hello.lua"
|
||||
>
|
||||
</File>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Mixed language support
|
||||
--
|
||||
|
||||
function suite.CompileAsC_InCppProject()
|
||||
language "c++"
|
||||
files { "hello.c" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelativePath="hello.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.CompileAsCpp_InCProject()
|
||||
language "c"
|
||||
files { "hello.cpp" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelativePath="hello.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- PCH support
|
||||
--
|
||||
|
||||
function suite.OnPCH_OnWindows()
|
||||
files { "afxwin.cpp" }
|
||||
pchsource "afxwin.cpp"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelativePath="afxwin.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.Files_OnPCH_OnXbox360()
|
||||
files { "afxwin.cpp" }
|
||||
pchsource "afxwin.cpp"
|
||||
platforms { "Xbox360" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<File
|
||||
RelativePath="afxwin.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Xbox 360"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLX360CompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Xbox 360"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLX360CompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
]]
|
||||
end
|
||||
|
@ -0,0 +1,58 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc200x/test_filters.lua
|
||||
-- Validate generation of filter blocks in Visual Studio 200x C/C++ projects.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vs200x_filters = { }
|
||||
local suite = T.vs200x_filters
|
||||
local vc200x = premake.vstudio.vc200x
|
||||
|
||||
|
||||
--
|
||||
-- Setup/teardown
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
local os_uuid
|
||||
|
||||
function suite.setup()
|
||||
os_uuid = os.uuid
|
||||
os.uuid = function() return "00112233-4455-6677-8888-99AABBCCDDEE" end
|
||||
|
||||
_ACTION = "vs2008"
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
function suite.teardown()
|
||||
os.uuid = os_uuid
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
prj = premake.solution.getproject(sln,1)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- File/filter assignment tests
|
||||
--
|
||||
|
||||
function suite.Filter_UsesVirtualForm_OnVpath()
|
||||
files { "src/hello.cpp" }
|
||||
vpaths { ["Source Files"] = "**.cpp" }
|
||||
prepare()
|
||||
vc200x.Files(prj)
|
||||
test.capture [[
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter=""
|
||||
>
|
||||
<File
|
||||
RelativePath="src\hello.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
]]
|
||||
end
|
@ -0,0 +1,78 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_config_props.lua
|
||||
-- Validate generation of the configuration property group.
|
||||
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_config_props = { }
|
||||
local suite = T.vstudio_vs2010_config_props
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
local project = premake.project
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare(platform)
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
local cfginfo = sln.vstudio_configs[1]
|
||||
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
|
||||
vc2010.configurationPropertyGroup(cfg, cfginfo)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the structure with the default project values.
|
||||
--
|
||||
|
||||
function suite.structureIsCorrect_onDefaultValues()
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Visual Studio 2012 adds a platform toolset.
|
||||
--
|
||||
|
||||
function suite.structureIsCorrect_onDefaultValues()
|
||||
_ACTION = "vs2012"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.structureIsCorrect_onDefaultValues_on2013()
|
||||
_ACTION = "vs2013"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
@ -0,0 +1,96 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_debugdir.lua
|
||||
-- Validate handling of the working directory for debugging.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_debugdir = { }
|
||||
local suite = T.vstudio_vs2010_debugdir
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
vc2010.debugdir(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.PrintsNothing_OnDebugDirSet()
|
||||
prepare()
|
||||
test.capture [[
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.IsFormattedCorrectly_OnRelativePath()
|
||||
debugdir "bin/debug"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<LocalDebuggerWorkingDirectory>bin\debug</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.Arguments()
|
||||
debugargs { "arg1", "arg2" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<LocalDebuggerCommandArguments>arg1 arg2</LocalDebuggerCommandArguments>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
|
||||
T.vs2010_debug_environment = { }
|
||||
local vs10_debug_environment = T.vs2010_debug_environment
|
||||
local vs2010 = premake.vstudio.vc2010
|
||||
|
||||
function vs10_debug_environment.config_noDebugEnvsTable_bufferDoesNotContainLocalDebuggerEnvironment()
|
||||
vs2010.debugenvs( {flags={}} )
|
||||
test.string_does_not_contain(io.endcapture(),'<LocalDebuggerEnvironment>')
|
||||
end
|
||||
|
||||
function vs10_debug_environment.config_NoneEmtpyDebugEnvTable_bufferContainsLocalDebuggerEnvironment()
|
||||
vs2010.debugenvs({flags={},debugenvs ={'key=value'}} )
|
||||
test.string_contains(io.endcapture(),'<LocalDebuggerEnvironment>')
|
||||
end
|
||||
|
||||
function vs10_debug_environment.format_listContainsOneEntry_openTagKeyValuePairCloseTag()
|
||||
vs2010.debugenvs({flags={},debugenvs ={'key=value'}} )
|
||||
test.string_contains(io.endcapture(),'<LocalDebuggerEnvironment>key=value</LocalDebuggerEnvironment>')
|
||||
end
|
||||
|
||||
function vs10_debug_environment.format_listContainsTwoEntries_openTagFirstPairNewLineSecondPairCloseTag()
|
||||
vs2010.debugenvs({flags={},debugenvs ={'key=value','foo=bar'}} )
|
||||
test.string_contains(io.endcapture(),'<LocalDebuggerEnvironment>key=value\nfoo=bar</LocalDebuggerEnvironment>')
|
||||
end
|
||||
|
||||
function vs10_debug_environment.flags_withOutEnvironmentArgsInherit_doesNotContainLocalDebuggerEnvironmentArg()
|
||||
vs2010.debugenvs({flags={},environmentargs ={'key=value'}} )
|
||||
test.string_does_not_contain(io.endcapture(),'%$%(LocalDebuggerEnvironment%)')
|
||||
end
|
||||
|
||||
function vs10_debug_environment.flags_withDebugEnvsInherit_endsWithNewLineLocalDebuggerEnvironmentFollowedByClosedTag()
|
||||
vs2010.debugenvs({flags={DebugEnvsInherit=1},debugenvs ={'key=value'}} )
|
||||
test.string_contains(io.endcapture(),'\n%$%(LocalDebuggerEnvironment%)</LocalDebuggerEnvironment>')
|
||||
end
|
||||
|
||||
function vs10_debug_environment.flags_withDebugEnvsDontMerge_localDebuggerMergeEnvironmentSetToFalse()
|
||||
vs2010.debugenvs({flags={DebugEnvsDontMerge=1},debugenvs ={'key=value'}} )
|
||||
test.string_contains(io.endcapture(),'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')
|
||||
end
|
103
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc2010/test_files.lua
vendored
Normal file
103
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc2010/test_files.lua
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_files.lua
|
||||
-- Validate generation of files block in Visual Studio 2010 C/C++ projects.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_files = { }
|
||||
local suite = T.vstudio_vs2010_files
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
vc2010.files(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test file groups
|
||||
--
|
||||
|
||||
function suite.SimpleHeaderFile()
|
||||
files { "include/hello.h" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\hello.h" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.SimpleSourceFile()
|
||||
files { "hello.c" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="hello.c">
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.SimpleObjectFile()
|
||||
files { "hello.obj" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<Object Include="hello.obj" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.SimpleNoneFile()
|
||||
files { "docs/hello.txt" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<None Include="docs\hello.txt" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.SimpleResourceFile()
|
||||
files { "resources/hello.rc" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="resources\hello.rc" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test path handling
|
||||
--
|
||||
|
||||
function suite.MultipleFolderLevels()
|
||||
files { "src/greetings/hello.c" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\greetings\hello.c">
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
193
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc2010/test_filters.lua
vendored
Normal file
193
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc2010/test_filters.lua
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_filters.lua
|
||||
-- Validate generation of filter blocks in Visual Studio 2010 C/C++ projects.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vs2010_filters = { }
|
||||
local suite = T.vs2010_filters
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup/teardown
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
local os_uuid
|
||||
|
||||
function suite.setup()
|
||||
os_uuid = os.uuid
|
||||
os.uuid = function() return "00112233-4455-6677-8888-99AABBCCDDEE" end
|
||||
|
||||
_ACTION = "vs2010"
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
function suite.teardown()
|
||||
os.uuid = os_uuid
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Filter identifiers sections
|
||||
--
|
||||
|
||||
function suite.UniqueIdentifiers_IsEmpty_OnRootFilesOnly()
|
||||
files { "hello.c", "goodbye.c" }
|
||||
prepare()
|
||||
vc2010.filteridgroup(prj)
|
||||
test.isemptycapture()
|
||||
end
|
||||
|
||||
|
||||
function suite.UniqueIdentifiers_MergeCommonSubfolders()
|
||||
files { "src/hello.c", "src/goodbye.c" }
|
||||
prepare()
|
||||
vc2010.filteridgroup(prj)
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{00112233-4455-6677-8888-99AABBCCDDEE}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.UniqueIdentifiers_ListAllSubfolders()
|
||||
files { "src/hello.c", "src/departures/goodbye.c" }
|
||||
prepare()
|
||||
vc2010.filteridgroup(prj)
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{00112233-4455-6677-8888-99AABBCCDDEE}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\departures">
|
||||
<UniqueIdentifier>{00112233-4455-6677-8888-99AABBCCDDEE}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.UniqueIdentifiers_ListVpaths()
|
||||
files { "hello.c", "goodbye.c" }
|
||||
vpaths { ["Source Files"] = "**.c" }
|
||||
prepare()
|
||||
vc2010.filteridgroup(prj)
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{00112233-4455-6677-8888-99AABBCCDDEE}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.UniqueIdentifiers_ListRealAndVpaths()
|
||||
files { "hello.h", "goodbye.c" }
|
||||
vpaths { ["Source Files"] = "*.c", ["Header Files"] = "*.h" }
|
||||
prepare()
|
||||
vc2010.filteridgroup(prj)
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{00112233-4455-6677-8888-99AABBCCDDEE}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{00112233-4455-6677-8888-99AABBCCDDEE}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- File/filter assignment tests
|
||||
--
|
||||
|
||||
function suite.FileFilters_NoFilter_OnRootFile()
|
||||
files { "hello.c", "goodbye.c" }
|
||||
prepare()
|
||||
vc2010.filefiltergroup(prj, "ClCompile")
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="hello.c" />
|
||||
<ClCompile Include="goodbye.c" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.FileFilters_NoFilter_OnRealPath()
|
||||
files { "src/hello.c" }
|
||||
prepare()
|
||||
vc2010.filefiltergroup(prj, "ClCompile")
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\hello.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.FileFilters_HasFilter_OnVpath()
|
||||
files { "src/hello.c" }
|
||||
vpaths { ["Source Files"] = "**.c" }
|
||||
prepare()
|
||||
vc2010.filefiltergroup(prj, "ClCompile")
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\hello.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.FileFilters_OnIncludeSection()
|
||||
files { "hello.c", "hello.h", "hello.rc", "hello.txt" }
|
||||
prepare()
|
||||
vc2010.filefiltergroup(prj, "ClInclude")
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClInclude Include="hello.h" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.FileFilters_OnResourceSection()
|
||||
files { "hello.c", "hello.h", "hello.rc", "hello.txt" }
|
||||
prepare()
|
||||
vc2010.filefiltergroup(prj, "ResourceCompile")
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="hello.rc" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.FileFilters_OnNoneSection()
|
||||
files { "hello.c", "hello.h", "hello.rc", "hello.txt" }
|
||||
prepare()
|
||||
vc2010.filefiltergroup(prj, "None")
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<None Include="hello.txt" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
@ -0,0 +1,45 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_header.lua
|
||||
-- Validate generation of the project file header block.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_header = { }
|
||||
local suite = T.vstudio_vs2010_header
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = 'vs2010'
|
||||
sln = test.createsolution()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.On2010_WithNoTarget()
|
||||
vc2010.header()
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.On2010_WithTarget()
|
||||
vc2010.header("Build")
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
]]
|
||||
end
|
@ -0,0 +1,229 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_link_settings.lua
|
||||
-- Validate linker settings in Visual Studio 2010 C/C++ projects.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_link_settings = { }
|
||||
local suite = T.vstudio_vs2010_link_settings
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj, cfg
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "vs2010"
|
||||
sln, prj = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare(platform)
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
cfg = premake.getconfig(prj, "Debug", platform)
|
||||
vc2010.link(cfg)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the basic element structure for a console application.
|
||||
--
|
||||
|
||||
function suite.writesCorrectSubsystem_onConsoleApp()
|
||||
kind "ConsoleApp"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the basic element structure for a windowed application.
|
||||
--
|
||||
|
||||
function suite.writesCorrectSubsystem_onWindowedApp()
|
||||
kind "WindowedApp"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the basic element structure for a shared library.
|
||||
--
|
||||
|
||||
function suite.writesCorrectSubsystem_onSharedLib()
|
||||
kind "SharedLib"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.dll</OutputFile>
|
||||
<ImportLibrary>MyProject.lib</ImportLibrary>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the basic element structure for a static library.
|
||||
--
|
||||
|
||||
function suite.writesCorrectSubsystem_onStaticLib()
|
||||
kind "StaticLib"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the structure of the additional library directories element.
|
||||
--
|
||||
|
||||
function suite.additionalLibraryDirectories()
|
||||
libdirs { "include/GL", "include/lua" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>include\GL;include\lua;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Enable debug information if the Symbols flag is specified.
|
||||
--
|
||||
|
||||
function suite.generateDebugInformation_onSymbolsFlag()
|
||||
flags { "Symbols" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Enable reference optimizing if Optimize flag is specified.
|
||||
--
|
||||
|
||||
function suite.optimizeReferences_onOptimizeFlag()
|
||||
flags { "Optimize" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Skip the entry point override if the WinMain flag is specified.
|
||||
--
|
||||
|
||||
function suite.noEntryPointElement_onWinMainFlag()
|
||||
flags { "WinMain" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Use the x86 target for Premake's x32 platform.
|
||||
--
|
||||
|
||||
function suite.writesCorrectTarget_onX32Platform()
|
||||
platforms "x32"
|
||||
prepare("x32")
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Use the x64 target for Premake's x64 platform.
|
||||
--
|
||||
|
||||
function suite.writesCorrectTarget_onX64Platform()
|
||||
platforms { "x64" }
|
||||
prepare("x64")
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Correctly handle module definition (.def) files.
|
||||
--
|
||||
|
||||
function suite.recognizesModuleDefinitionFile()
|
||||
files { "hello.cpp", "hello.def" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<ModuleDefinitionFile>hello.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
]]
|
||||
end
|
@ -0,0 +1,93 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_links.lua
|
||||
-- Validate linking and project references in Visual Studio 2010 C/C++ projects.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_links = { }
|
||||
local suite = T.vstudio_vs2010_links
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj, prj2
|
||||
|
||||
function suite.setup()
|
||||
os_uuid = os.uuid
|
||||
os.uuid = function() return "00112233-4455-6677-8888-99AABBCCDDEE" end
|
||||
|
||||
sln = test.createsolution()
|
||||
test.createproject(sln)
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
prj2 = premake.solution.getproject(sln, 2)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If there are no sibling projects listed in links(), then the
|
||||
-- entire project references item group should be skipped.
|
||||
--
|
||||
|
||||
function suite.noProjectReferencesGroup_onNoSiblingReferences()
|
||||
prepare()
|
||||
vc2010.projectReferences(prj2)
|
||||
test.isemptycapture()
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If a sibling project is listed in links(), an item group should
|
||||
-- be written with a reference to that sibling project.
|
||||
--
|
||||
|
||||
function suite.projectReferenceAdded_onSiblingProjectLink()
|
||||
links { "MyProject" }
|
||||
prepare()
|
||||
vc2010.projectReferences(prj2)
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="MyProject.vcproj">
|
||||
<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If a sibling library is listed in links(), it should NOT appear in
|
||||
-- the additional dependencies element. Visual Studio will figure that
|
||||
-- out from the project reference item group.
|
||||
--
|
||||
|
||||
function suite.noDependencies_onOnlySiblingProjectLinks()
|
||||
links { "MyProject" }
|
||||
prepare()
|
||||
vc2010.additionalDependencies(prj2)
|
||||
test.isemptycapture()
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If a mix of sibling and system links are listed, only the system
|
||||
-- libraries should appear in the additional dependencies element.
|
||||
--
|
||||
|
||||
function suite.onlySystemDependencies_OnSiblingProjectLink()
|
||||
links { "MyProject", "kernel32" }
|
||||
prepare()
|
||||
vc2010.additionalDependencies(prj2)
|
||||
test.capture [[
|
||||
<AdditionalDependencies>kernel32;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
]]
|
||||
end
|
||||
|
||||
|
@ -0,0 +1,179 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_output_props.lua
|
||||
-- Validate generation of the output property groups.
|
||||
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_output_props = {}
|
||||
local suite = T.vstudio_vs2010_output_props
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "vs2010"
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
local prj = premake.solution.getproject(sln, 1)
|
||||
vc2010.outputProperties(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the structure with the default project values.
|
||||
--
|
||||
|
||||
function suite.structureIsCorrect_onDefaultValues()
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.exe</TargetExt>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Static libraries should omit the link incremental element entirely.
|
||||
--
|
||||
|
||||
function suite.omitLinkIncremental_onStaticLib()
|
||||
kind "StaticLib"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.lib</TargetExt>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- Optimized builds should not link incrementally.
|
||||
--
|
||||
|
||||
function suite.noIncrementalLink_onOptimizedBuild()
|
||||
flags "Optimize"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.exe</TargetExt>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- The target directory is applied, if specified.
|
||||
--
|
||||
|
||||
function suite.outDir_onTargetDir()
|
||||
targetdir "../bin"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>..\bin\</OutDir>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- The objeccts directory is applied, if specified.
|
||||
--
|
||||
|
||||
function suite.intDir_onTargetDir()
|
||||
objdir "../tmp"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>..\tmp\Debug\</IntDir>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- The target name is applied, if specified.
|
||||
--
|
||||
|
||||
function suite.targetName_onTargetName()
|
||||
targetname "MyTarget"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyTarget</TargetName>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- A target extension should be used if specified.
|
||||
--
|
||||
|
||||
function suite.targetExt_onTargetExtension()
|
||||
targetextension ".delta"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.delta</TargetExt>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- If the NoImportLib flag is set, add the IgnoreImportLibrary element.
|
||||
--
|
||||
|
||||
function suite.ignoreImportLib_onNoImportLib()
|
||||
kind "SharedLib"
|
||||
flags "NoImportLib"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If the NoManifest flag is set, add the GenerateManifest element.
|
||||
--
|
||||
|
||||
function suite.generateManifest_onNoManifest()
|
||||
flags "NoManifest"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>.\</OutDir>
|
||||
<IntDir>obj\Debug\</IntDir>
|
||||
<TargetName>MyProject</TargetName>
|
||||
<TargetExt>.exe</TargetExt>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
63
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc2010/test_pch.lua
vendored
Normal file
63
Src/external_dependencies/openmpt-trunk/include/genie/tests/actions/vstudio/vc2010/test_pch.lua
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_pch.lua
|
||||
-- Validate generation of files block in Visual Studio 2010 C/C++ projects.
|
||||
-- Copyright (c) 2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_pch = { }
|
||||
local suite = T.vstudio_vs2010_pch
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
sln = test.createsolution()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 1)
|
||||
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
|
||||
vc2010.files(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Tests
|
||||
--
|
||||
|
||||
function suite.pch_OnProject()
|
||||
files { "afxwin.cpp" }
|
||||
pchheader "afxwin.h"
|
||||
pchsource "afxwin.cpp"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="afxwin.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.pch_OnSingleConfig()
|
||||
files { "afxwin.cpp" }
|
||||
configuration "Debug"
|
||||
pchheader "afxwin.h"
|
||||
pchsource "afxwin.cpp"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="afxwin.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
@ -0,0 +1,78 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_project_refs.lua
|
||||
-- Validate project references in Visual Studio 2010 C/C++ projects.
|
||||
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.vstudio_vs2010_project_refs = { }
|
||||
local suite = T.vstudio_vs2010_project_refs
|
||||
local vc2010 = premake.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local sln, prj
|
||||
|
||||
function suite.setup()
|
||||
_ACTION = "vs2010"
|
||||
sln = test.createsolution()
|
||||
uuid "00112233-4455-6677-8888-99AABBCCDDEE"
|
||||
test.createproject(sln)
|
||||
end
|
||||
|
||||
local function prepare(platform)
|
||||
premake.bake.buildconfigs()
|
||||
prj = premake.solution.getproject(sln, 2)
|
||||
vc2010.projectReferences(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If there are no sibling projects listed in links(), then the
|
||||
-- entire project references item group should be skipped.
|
||||
--
|
||||
|
||||
function suite.noProjectReferencesGroup_onNoSiblingReferences()
|
||||
prepare()
|
||||
test.isemptycapture()
|
||||
end
|
||||
|
||||
--
|
||||
-- If a sibling project is listed in links(), an item group should
|
||||
-- be written with a reference to that sibling project.
|
||||
--
|
||||
|
||||
function suite.projectReferenceAdded_onSiblingProjectLink()
|
||||
links { "MyProject" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="MyProject.vcxproj">
|
||||
<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- Project references should always be specified relative to the
|
||||
-- project doing the referencing.
|
||||
--
|
||||
|
||||
function suite.referencesAreRelative_onDifferentProjectLocation()
|
||||
links { "MyProject" }
|
||||
location "build/MyProject2"
|
||||
project("MyProject")
|
||||
location "build/MyProject"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MyProject\MyProject.vcxproj">
|
||||
<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
Reference in New Issue
Block a user