From 2b95fc299c0b9ae359fbe3587c497889222cd63b Mon Sep 17 00:00:00 2001 From: Liam Devine Date: Fri, 11 Mar 2011 16:43:19 +0000 Subject: Xcode4 workspace initial --- tests/actions/xcode/test_xcode4_workspace.lua | 63 +++++++++++++++++++++++++++ tests/premake4.lua | 1 + 2 files changed, 64 insertions(+) create mode 100644 tests/actions/xcode/test_xcode4_workspace.lua (limited to 'tests') diff --git a/tests/actions/xcode/test_xcode4_workspace.lua b/tests/actions/xcode/test_xcode4_workspace.lua new file mode 100644 index 0000000..09fd66b --- /dev/null +++ b/tests/actions/xcode/test_xcode4_workspace.lua @@ -0,0 +1,63 @@ + T.xcode4_workspace = { } + + local suite = T.xcode4_workspace + + --[[suite.--]]local CONSTANT_PROJECT_NAME = "MyProject" + + local sln, prj + function suite.teardown() + sln = nil + prj = nil + end + function suite.setup() + _ACTION = "xcode4" + + sln = solution "MySolution" + configurations { "Debug", "Release" } + platforms {} + + prj = project (CONSTANT_PROJECT_NAME) --"MyProject" + language "C++" + kind "ConsoleApp" + uuid "AE61726D-187C-E440-BD07-2556188A6565" + end + + local function get_buffer() + premake.buildconfigs() + premake.xcode4.workspace_generate(sln) + local buffer = io.endcapture() + return buffer + end + + function suite.xmlDeclarationPresent() + local buffer = get_buffer() + test.string_contains(buffer, '<%?xml version="1%.0" encoding="UTF%-8"%?>') + end + + function suite.workspace_detailsEnclosedByVersionOneWorkSpaceTag() + local buffer = get_buffer() + test.string_contains(buffer,'.*') + end + + function suite.workspace_addsProjectInFileRefTags() + local buffer = get_buffer() + test.string_contains(buffer,'%s+%s+') + end + + function suite.workspace_fileRefFormat_locationAndGroup() + local buffer = get_buffer() + test.string_contains(buffer,'.*%s+') + end + function suite.workspace_fileRefFormat_projectNameAndExtension() + local buffer = get_buffer() + test.string_contains(buffer,'.*%s+') + end + + function suite.pathPrefixAndProjectName_pathIsSameDir_noPrefixAdded() + local buffer = get_buffer() + test.string_contains(buffer,'.*%s+') + end diff --git a/tests/premake4.lua b/tests/premake4.lua index cef6297..13c060a 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -99,6 +99,7 @@ dofile("actions/xcode/test_xcode_project.lua") dofile("actions/xcode/test_xcode_dependencies.lua") + dofile("actions/xcode/test_xcode4_workspace.lua") -- -- Register a test action -- cgit v1.2.3