-- -- tests/actions/xcode/test_xcode_project.lua -- Automated test suite for Xcode project generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.xcode3_project = { } local suite = T.xcode3_project local xcode = premake.xcode --------------------------------------------------------------------------- -- Setup/Teardown --------------------------------------------------------------------------- local sln, tr function suite.setup() premake.action.set("xcode3") xcode.used_ids = { } -- reset the list of generated IDs sln = test.createsolution() end local function prepare() io.capture() premake.buildconfigs() local prj = premake.solution.getproject(sln, 1) tr = xcode.buildprjtree(prj) end --------------------------------------------------------------------------- -- PBXBuildFile tests --------------------------------------------------------------------------- function suite.PBXBuildFile_ListsBuildableSources() files { "source.h", "source.c", "source.cpp", "Info.plist" } prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [source.c:build] /* source.c in Sources */ = {isa = PBXBuildFile; fileRef = [source.c] /* source.c */; }; [source.cpp:build] /* source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = [source.cpp] /* source.cpp */; }; /* End PBXBuildFile section */ ]] end function suite.PBXBuildFile_ListsResourceFilesOnlyOnceWithGroupID() files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" } prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [MainMenu.xib:build] /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = [MainMenu.xib] /* MainMenu.xib */; }; /* End PBXBuildFile section */ ]] end function suite.PBXBuildFile_ListsFrameworks() links { "Cocoa.framework" } prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [Cocoa.framework:build] /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = [Cocoa.framework] /* Cocoa.framework */; }; /* End PBXBuildFile section */ ]] end