From e78d5c2a16345b36f92fabccd3efd80742bc21b1 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Mon, 22 Aug 2011 16:35:51 -0400 Subject: Fixed #3381011: location breaks vpaths --- tests/project/test_vpaths.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tests') diff --git a/tests/project/test_vpaths.lua b/tests/project/test_vpaths.lua index 49631e2..8616907 100644 --- a/tests/project/test_vpaths.lua +++ b/tests/project/test_vpaths.lua @@ -124,3 +124,32 @@ prepare() test.isequal("src/hello.c", project.getvpath(prj, "../../src/hello.c")) end + + +-- +-- Test with project locations +-- + + function suite.MatchPath_OnProjectLocationSet() + location "build" + files "src/hello.h" + vpaths { [""] = "src" } + prepare() + test.isequal("hello.h", project.getvpath(prj, prj.files[1])) + end + + function suite.MatchFilePattern_OnProjectLocationSet() + location "build" + files "src/hello.h" + vpaths { ["Headers"] = "**.h" } + prepare() + test.isequal("Headers/hello.h", project.getvpath(prj, prj.files[1])) + end + + function suite.MatchFilePatternWithPath_OnProjectLocationSet() + location "build" + files "src/hello.h" + vpaths { ["Headers"] = "src/**.h" } + prepare() + test.isequal("Headers/hello.h", project.getvpath(prj, prj.files[1])) + end -- cgit v1.2.3 From 363a445f72d639db58f39d021b2ec4e4af8e27c4 Mon Sep 17 00:00:00 2001 From: Liam Devine Date: Thu, 8 Sep 2011 14:30:10 +0100 Subject: * Bug 3381149: Path of PCH source file in VS10 not being translated (intyuh) Re- added unit test removed in 53abc69ab87c Applied patch from intyuh --- tests/actions/vstudio/test_vs2010_vcxproj.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/actions/vstudio/test_vs2010_vcxproj.lua b/tests/actions/vstudio/test_vs2010_vcxproj.lua index c28402f..d5de698 100644 --- a/tests/actions/vstudio/test_vs2010_vcxproj.lua +++ b/tests/actions/vstudio/test_vs2010_vcxproj.lua @@ -334,7 +334,13 @@ 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() -- cgit v1.2.3 From 611014c522a72ea942f5e7fc2097f48ed8e7476d Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Thu, 15 Sep 2011 16:45:48 -0400 Subject: Patch 3021550: Add Wii homebrew platform (Pathogen David) --- tests/actions/make/test_makesettings.lua | 51 +++++++++++++++++++++++++++++ tests/actions/make/test_wiidev.lua | 56 ++++++++++++++++++++++++++++++++ tests/premake4.lua | 4 ++- tests/test_gmake_cpp.lua | 8 ++--- tests/testfx.lua | 1 + 5 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 tests/actions/make/test_makesettings.lua create mode 100644 tests/actions/make/test_wiidev.lua (limited to 'tests') diff --git a/tests/actions/make/test_makesettings.lua b/tests/actions/make/test_makesettings.lua new file mode 100644 index 0000000..8a6f132 --- /dev/null +++ b/tests/actions/make/test_makesettings.lua @@ -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 + diff --git a/tests/actions/make/test_wiidev.lua b/tests/actions/make/test_wiidev.lua new file mode 100644 index 0000000..9ed707f --- /dev/null +++ b/tests/actions/make/test_wiidev.lua @@ -0,0 +1,56 @@ +-- +-- 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 [[ + CPPFLAGS += -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) -MP $(DEFINES) $(INCLUDES) + CFLAGS += $(CPPFLAGS) $(ARCH) + CXXFLAGS += $(CFLAGS) + LDFLAGS += -s lwiiuse -lbte -logc -lm -L$(LIBOGC_LIB) $(MACHDEP) + RESFLAGS += $(DEFINES) $(INCLUDES) + ]] + 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 diff --git a/tests/premake4.lua b/tests/premake4.lua index 00ce43f..7f915c9 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -112,7 +112,9 @@ dofile("actions/make/test_make_escaping.lua") dofile("actions/make/test_make_pch.lua") dofile("actions/make/test_make_linking.lua") - + -- dofile("actions/make/test_makesettings.lua") + dofile("actions/make/test_wiidev.lua") + -- Xcode3 tests dofile("actions/xcode/test_xcode_common.lua") dofile("actions/xcode/test_xcode_project.lua") diff --git a/tests/test_gmake_cpp.lua b/tests/test_gmake_cpp.lua index 5730ca9..8c80411 100644 --- a/tests/test_gmake_cpp.lua +++ b/tests/test_gmake_cpp.lua @@ -82,8 +82,8 @@ ifeq ($(config),debug) CFLAGS += $(CPPFLAGS) $(ARCH) CXXFLAGS += $(CFLAGS) LDFLAGS += -s - LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) + LIBS += LDDEPS += LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS @@ -116,8 +116,8 @@ ifeq ($(config),debugps3) CFLAGS += $(CPPFLAGS) $(ARCH) CXXFLAGS += $(CFLAGS) LDFLAGS += -s - LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) + LIBS += LDDEPS += LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS @@ -147,8 +147,8 @@ ifeq ($(config),debug64) CFLAGS += $(CPPFLAGS) $(ARCH) -m64 CXXFLAGS += $(CFLAGS) LDFLAGS += -s -m64 -L/usr/lib64 - LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) + LIBS += LDDEPS += LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS @@ -179,8 +179,8 @@ ifeq ($(config),debuguniv32) CFLAGS += $(CPPFLAGS) $(ARCH) -arch i386 -arch ppc CXXFLAGS += $(CFLAGS) LDFLAGS += -s -arch i386 -arch ppc - LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) + LIBS += LDDEPS += LINKCMD = libtool -o $(TARGET) $(OBJECTS) define PREBUILDCMDS diff --git a/tests/testfx.lua b/tests/testfx.lua index 1182a13..c5b49e5 100644 --- a/tests/testfx.lua +++ b/tests/testfx.lua @@ -199,6 +199,7 @@ _OPTIONS = { } premake.solution.list = { } io.indent = nil + io.eol = "\n" -- reset captured I/O values test.value_openedfilename = nil -- cgit v1.2.3 From 7c9dea1f22e2b7dc82ea7ef88be0a9350ec00b55 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Mon, 19 Sep 2011 16:45:49 -0400 Subject: Patch 3035550: Make/Distcc outputs dependencies to wrong location --- tests/actions/make/test_make_pch.lua | 4 ++-- tests/actions/make/test_wiidev.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/actions/make/test_make_pch.lua b/tests/actions/make/test_make_pch.lua index 8d772d4..2315f31 100644 --- a/tests/actions/make/test_make_pch.lua +++ b/tests/actions/make/test_make_pch.lua @@ -69,7 +69,7 @@ ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" endif ]] end @@ -84,7 +84,7 @@ ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) - $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" + $(SILENT) $(CC) $(CFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" endif ]] end diff --git a/tests/actions/make/test_wiidev.lua b/tests/actions/make/test_wiidev.lua index 9ed707f..fd0bfdd 100644 --- a/tests/actions/make/test_wiidev.lua +++ b/tests/actions/make/test_wiidev.lua @@ -35,7 +35,7 @@ CPPFLAGS += -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) CXXFLAGS += $(CFLAGS) - LDFLAGS += -s lwiiuse -lbte -logc -lm -L$(LIBOGC_LIB) $(MACHDEP) + LDFLAGS += -s -L$(LIBOGC_LIB) $(MACHDEP) RESFLAGS += $(DEFINES) $(INCLUDES) ]] end -- cgit v1.2.3 From 1cb9aad19be8ac08da20600a813e62ebdd40091f Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Thu, 20 Oct 2011 16:36:24 -0400 Subject: Patch 3367641: Remove warnings in Xcode 4 --- tests/actions/xcode/test_xcode4_project.lua | 59 +++++++++++++++++++++++++ tests/actions/xcode/test_xcode_dependencies.lua | 4 +- tests/actions/xcode/test_xcode_project.lua | 35 ++------------- tests/premake4.lua | 1 + 4 files changed, 65 insertions(+), 34 deletions(-) create mode 100644 tests/actions/xcode/test_xcode4_project.lua (limited to 'tests') diff --git a/tests/actions/xcode/test_xcode4_project.lua b/tests/actions/xcode/test_xcode4_project.lua new file mode 100644 index 0000000..30cda28 --- /dev/null +++ b/tests/actions/xcode/test_xcode4_project.lua @@ -0,0 +1,59 @@ +-- +-- tests/actions/xcode/test_xcode4_project.lua +-- Automated test suite for Xcode project generation. +-- Copyright (c) 2011 Jason Perkins and the Premake project +-- + + T.xcode4_project = { } + + local suite = T.xcode4_project + local xcode = premake.xcode + + +--------------------------------------------------------------------------- +-- Setup/Teardown +--------------------------------------------------------------------------- + + local sln, tr + function suite.setup() + _ACTION = "xcode4" + io.eol = "\n" + xcode.used_ids = { } -- reset the list of generated IDs + sln = test.createsolution() + end + + local function prepare() + premake.bake.buildconfigs() + xcode.preparesolution(sln) + local prj = premake.solution.getproject(sln, 1) + tr = xcode.buildprjtree(prj) + end + + +--------------------------------------------------------------------------- +-- XCBuildConfiguration_Project tests +--------------------------------------------------------------------------- + + function suite.XCBuildConfigurationProject_OnSymbols() + flags { "Symbols" } + prepare() + xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) + test.capture [[ + [MyProject:Debug(2)] /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OBJROOT = "obj/Debug"; + ONLY_ACTIVE_ARCH = YES; + }; + name = "Debug"; + }; + ]] + end diff --git a/tests/actions/xcode/test_xcode_dependencies.lua b/tests/actions/xcode/test_xcode_dependencies.lua index e748b2b..ad14d5e 100644 --- a/tests/actions/xcode/test_xcode_dependencies.lua +++ b/tests/actions/xcode/test_xcode_dependencies.lua @@ -1,7 +1,7 @@ -- -- tests/actions/xcode/test_xcode_dependencies.lua -- Automated test suite for Xcode project dependencies. --- Copyright (c) 2009 Jason Perkins and the Premake project +-- Copyright (c) 2009-2011 Jason Perkins and the Premake project -- T.xcode3_deps = { } @@ -249,7 +249,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; hasScannedForEncodings = 1; mainGroup = [MyProject] /* MyProject */; projectDirPath = ""; diff --git a/tests/actions/xcode/test_xcode_project.lua b/tests/actions/xcode/test_xcode_project.lua index 4ab50ba..1ecde36 100644 --- a/tests/actions/xcode/test_xcode_project.lua +++ b/tests/actions/xcode/test_xcode_project.lua @@ -1,7 +1,7 @@ -- -- tests/actions/xcode/test_xcode_project.lua -- Automated test suite for Xcode project generation. --- Copyright (c) 2009-2010 Jason Perkins and the Premake project +-- Copyright (c) 2009-2011 Jason Perkins and the Premake project -- T.xcode3_project = { } @@ -16,7 +16,7 @@ local sln, tr function suite.setup() - premake.action.set("xcode3") + _ACTION = "xcode3" io.eol = "\n" xcode.used_ids = { } -- reset the list of generated IDs sln = test.createsolution() @@ -656,7 +656,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; hasScannedForEncodings = 1; mainGroup = [MyProject] /* MyProject */; projectDirPath = ""; @@ -1084,7 +1084,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1109,7 +1108,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1134,7 +1132,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1159,7 +1156,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; }; name = "Debug"; @@ -1186,7 +1182,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; SYMROOT = "bin"; }; name = "Debug"; @@ -1216,7 +1211,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1245,7 +1239,6 @@ ); OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1274,7 +1267,6 @@ "build option 1", "build option 2", ); - PREBINDING = NO; }; name = "Debug"; }; @@ -1302,7 +1294,6 @@ OTHER_LDFLAGS = ( "-lldap", ); - PREBINDING = NO; }; name = "Debug"; }; @@ -1330,7 +1321,6 @@ "link option 1", "link option 2", ); - PREBINDING = NO; }; name = "Debug"; }; @@ -1355,7 +1345,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; WARNING_CFLAGS = "-Wall"; }; name = "Debug"; @@ -1382,7 +1371,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1410,7 +1398,6 @@ OTHER_CFLAGS = ( "-ffast-math", ); - PREBINDING = NO; }; name = "Debug"; }; @@ -1438,7 +1425,6 @@ OTHER_CFLAGS = ( "-ffloat-store", ); - PREBINDING = NO; }; name = "Debug"; }; @@ -1464,7 +1450,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; }; name = "Debug"; }; @@ -1491,7 +1476,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1519,7 +1503,6 @@ OTHER_CFLAGS = ( "-fomit-frame-pointer", ); - PREBINDING = NO; }; name = "Debug"; }; @@ -1545,7 +1528,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1571,7 +1553,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1598,7 +1579,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; }; name = "Debug"; }; @@ -1627,7 +1607,6 @@ ); OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1654,7 +1633,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1679,7 +1657,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1704,7 +1681,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal32/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1729,7 +1705,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal64/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1754,7 +1729,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1779,7 +1753,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/x32/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1804,7 +1777,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/x64/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug"; }; @@ -1828,7 +1800,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal32/Debug"; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; }; name = "Debug 32-bit Universal"; }; diff --git a/tests/premake4.lua b/tests/premake4.lua index 7f915c9..9f5030e 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -121,6 +121,7 @@ dofile("actions/xcode/test_xcode_dependencies.lua") -- Xcode4 tests + dofile("actions/xcode/test_xcode4_project.lua") dofile("actions/xcode/test_xcode4_workspace.lua") -- CodeLite tests -- cgit v1.2.3 From 6ddd47a765805af55a9a5fd91d8b840241b5e52c Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Thu, 20 Oct 2011 16:44:09 -0400 Subject: Patch 3372345: Gmake action's PCHs don't work with Mingw (Martin Ridgers) --- tests/actions/make/test_make_pch.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/actions/make/test_make_pch.lua b/tests/actions/make/test_make_pch.lua index 2315f31..f52bf3e 100644 --- a/tests/actions/make/test_make_pch.lua +++ b/tests/actions/make/test_make_pch.lua @@ -68,7 +68,11 @@ ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) +ifeq (posix,$(SHELLTYPE)) -$(SILENT) cp $< $(OBJDIR) +else + $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul +endif $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" endif ]] @@ -83,7 +87,11 @@ endif ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) +ifeq (posix,$(SHELLTYPE)) -$(SILENT) cp $< $(OBJDIR) +else + $(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul +endif $(SILENT) $(CC) $(CFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" endif ]] -- cgit v1.2.3 From a9d58a40dcf7e41e4e1594cb4b93ea0459e8750d Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Fri, 21 Oct 2011 15:32:18 -0400 Subject: Patch 3317329: Support vstudio CompileAs for mixed-language projects (xpol) --- tests/actions/vstudio/vc200x/files.lua | 73 ++++++++++++++++++++++++--- tests/actions/vstudio/vc200x/test_filters.lua | 6 +-- 2 files changed, 70 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/actions/vstudio/vc200x/files.lua b/tests/actions/vstudio/vc200x/files.lua index facb17d..4633674 100644 --- a/tests/actions/vstudio/vc200x/files.lua +++ b/tests/actions/vstudio/vc200x/files.lua @@ -32,18 +32,18 @@ -- function suite.SimpleSourceFile() - files { "hello.c" } + files { "hello.cpp" } prepare() test.capture [[ ]] end function suite.SingleFolderLevel() - files { "src/hello.c" } + files { "src/hello.cpp" } prepare() test.capture [[ @@ -59,7 +59,7 @@ end function suite.MultipleFolderLevels() - files { "src/greetings/hello.c" } + files { "src/greetings/hello.cpp" } prepare() test.capture [[ @@ -80,6 +80,67 @@ end +-- +-- Mixed language support +-- + + function suite.CompileAsC_InCppProject() + language "c++" + files { "hello.c" } + prepare() + test.capture [[ + + + + + + + + + ]] + end + + function suite.CompileAsCpp_InCProject() + language "c" + files { "hello.cpp" } + prepare() + test.capture [[ + + + + + + + + + ]] + end + + -- -- PCH support -- diff --git a/tests/actions/vstudio/vc200x/test_filters.lua b/tests/actions/vstudio/vc200x/test_filters.lua index d2bb3cd..148dcd4 100644 --- a/tests/actions/vstudio/vc200x/test_filters.lua +++ b/tests/actions/vstudio/vc200x/test_filters.lua @@ -40,8 +40,8 @@ local vc200x = premake.vstudio.vc200x -- function suite.Filter_UsesVirtualForm_OnVpath() - files { "src/hello.c" } - vpaths { ["Source Files"] = "**.c" } + files { "src/hello.cpp" } + vpaths { ["Source Files"] = "**.cpp" } prepare() vc200x.Files(prj) test.capture [[ @@ -50,7 +50,7 @@ local vc200x = premake.vstudio.vc200x Filter="" > -- cgit v1.2.3 From 94a054c1a0a83133189e9c2b6b939a8a8f8abf66 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Tue, 8 Nov 2011 16:43:49 -0500 Subject: Patch 3381066: Fix VS2010 project references --- tests/actions/vstudio/vc2010/test_links.lua | 87 +++++++++++++++++++++++++++++ tests/premake4.lua | 19 ++++--- 2 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 tests/actions/vstudio/vc2010/test_links.lua (limited to 'tests') diff --git a/tests/actions/vstudio/vc2010/test_links.lua b/tests/actions/vstudio/vc2010/test_links.lua new file mode 100644 index 0000000..de642f5 --- /dev/null +++ b/tests/actions/vstudio/vc2010/test_links.lua @@ -0,0 +1,87 @@ +-- +-- 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.noSectionWritten_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 [[ + + + {00112233-4455-6677-8888-99AABBCCDDEE} + + + ]] + 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 + + function suite.onlySystemDependencies_OnSiblingProjectLink() + links { "MyProject", "kernel32" } + prepare() + vc2010.additionalDependencies(prj2) + test.capture [[ + kernel32;%(AdditionalDependencies) + ]] + end + + diff --git a/tests/premake4.lua b/tests/premake4.lua index 9f5030e..1b5ab45 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -13,7 +13,7 @@ test.createsolution = function() local sln = solution "MySolution" configurations { "Debug", "Release" } - + local prj = project "MyProject" language "C++" kind "ConsoleApp" @@ -25,7 +25,7 @@ test.createproject = function(sln) local n = #sln.projects + 1 if n == 1 then n = "" end - + local prj = project ("MyProject" .. n) language "C++" kind "ConsoleApp" @@ -60,14 +60,14 @@ dofile("test_project.lua") dofile("project/test_eachfile.lua") dofile("project/test_vpaths.lua") - + -- Baking tests dofile("base/test_baking.lua") dofile("baking/test_merging.lua") - + -- Clean tests dofile("actions/test_clean.lua") - + -- Visual Studio tests dofile("test_vs2002_sln.lua") dofile("test_vs2003_sln.lua") @@ -100,12 +100,13 @@ dofile("actions/vstudio/vc200x/header.lua") dofile("actions/vstudio/vc200x/files.lua") dofile("actions/vstudio/vc200x/test_filters.lua") - + -- Visual Studio 2010 C/C++ projects dofile("actions/vstudio/vc2010/test_debugdir.lua") dofile("actions/vstudio/vc2010/test_header.lua") dofile("actions/vstudio/vc2010/test_files.lua") dofile("actions/vstudio/vc2010/test_filters.lua") + dofile("actions/vstudio/vc2010/test_links.lua") dofile("actions/vstudio/vc2010/test_pch.lua") -- Makefile tests @@ -123,10 +124,10 @@ -- Xcode4 tests dofile("actions/xcode/test_xcode4_project.lua") dofile("actions/xcode/test_xcode4_workspace.lua") - + -- CodeLite tests dofile("actions/codelite/codelite_files.lua") - + -- CodeBlocks tests dofile("actions/codeblocks/codeblocks_files.lua") dofile("actions/codeblocks/test_filters.lua") @@ -138,7 +139,7 @@ newaction { trigger = "test", description = "Run the automated test suite", - + execute = function () passed, failed = test.runall() msg = string.format("%d tests passed, %d failed", passed, failed) -- cgit v1.2.3