diff options
author | Liam Devine <dmail00@gmail.com> | 2011-03-11 19:43:19 +0300 |
---|---|---|
committer | Liam Devine <dmail00@gmail.com> | 2011-03-11 19:43:19 +0300 |
commit | 2b95fc299c0b9ae359fbe3587c497889222cd63b (patch) | |
tree | e5d0b374650b45398750e1cb0db390eb40002f61 /tests/actions | |
parent | 2e9fbb9962fddcf45598f021c60afa153dc660a8 (diff) |
Xcode4 workspace initial
Diffstat (limited to 'tests/actions')
-rw-r--r-- | tests/actions/xcode/test_xcode4_workspace.lua | 63 |
1 files changed, 63 insertions, 0 deletions
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,'<Workspace%s+version = "1%.0">.*</Workspace>') + end + + function suite.workspace_addsProjectInFileRefTags() + local buffer = get_buffer() + test.string_contains(buffer,'<Workspace%s+version = "1%.0">%s+<FileRef.*</FileRef>%s+</Workspace>') + end + + function suite.workspace_fileRefFormat_locationAndGroup() + local buffer = get_buffer() + test.string_contains(buffer,'.*<FileRef%s+location = "group:.*">%s+</FileRef>') + end + function suite.workspace_fileRefFormat_projectNameAndExtension() + local buffer = get_buffer() + test.string_contains(buffer,'.*<FileRef%s+location = "group:' + .. CONSTANT_PROJECT_NAME .. '.xcodeproj' + ..'">%s+</FileRef>') + end + + function suite.pathPrefixAndProjectName_pathIsSameDir_noPrefixAdded() + local buffer = get_buffer() + test.string_contains(buffer,'.*<FileRef%s+location = "group:' + .. CONSTANT_PROJECT_NAME .. '.xcodeproj' + ..'">%s+</FileRef>') + end |