diff options
author | Jason Perkins <starkos@industriousone.com> | 2011-09-16 00:45:48 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2011-09-16 00:45:48 +0400 |
commit | 611014c522a72ea942f5e7fc2097f48ed8e7476d (patch) | |
tree | c416c4f8aa3172c058157393575e2c14544cb14a /tests | |
parent | 363a445f72d639db58f39d021b2ec4e4af8e27c4 (diff) |
Patch 3021550: Add Wii homebrew platform (Pathogen David)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/actions/make/test_makesettings.lua | 51 | ||||
-rw-r--r-- | tests/actions/make/test_wiidev.lua | 56 | ||||
-rw-r--r-- | tests/premake4.lua | 4 | ||||
-rw-r--r-- | tests/test_gmake_cpp.lua | 8 | ||||
-rw-r--r-- | tests/testfx.lua | 1 |
5 files changed, 115 insertions, 5 deletions
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 |