Skip to content
This repository was archived by the owner on Jun 2, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _manifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ return {
"xcode4_workspace.lua",
"xcode_common.lua",
"xcode_project.lua",
"xcode_scheme.lua",
}
1 change: 1 addition & 0 deletions _preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

onProject = function(prj)
p.generate(prj, ".xcodeproj/project.pbxproj", p.modules.xcode.generateProject)
p.generate(prj, ".xcodeproj/xcshareddata/xcschemes/" .. prj.name .. ".xcscheme", p.modules.xcode.generateScheme)
end,
}

Expand Down
1 change: 1 addition & 0 deletions tests/_tests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ return {
"test_xcode4_workspace.lua",
"test_xcode_dependencies.lua",
"test_xcode_project.lua",
"test_xcode_scheme.lua",
}
64 changes: 58 additions & 6 deletions tests/test_xcode_dependencies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,36 @@
-- Setup/Teardown
---------------------------------------------------------------------------

local wks, prj, prj2, tr
local wks, prj1, prj2, prj3, tr

function suite.teardown()
wks = nil
prj = nil
prj1 = nil
prj2 = nil
prj3 = nil
tr = nil
end

function suite.setup()
_ACTION = "xcode4"
xcode.used_ids = { } -- reset the list of generated IDs

wks, prj = test.createWorkspace()
wks, prj1 = test.createWorkspace()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it really your intention to create a second workspace? I would have thought createProject() would be more appropriate here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, I dont know =) I was trying to use the same logic/format as the other tests that were already in place. Certainly dont need multiple workspaces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search the code for test.createProject() and you'll find usage examples.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Near as I can tell, this is doing the same things as all the other tests...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I usually do:

local wks, prj1 = test.createWorkspace()
local prj2 = test.createproject()

Which puts both projects in the same workspace, instead of in two different workspaces.

Copy link
Author

@ratzlaff ratzlaff May 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please forgive my stubbornness but I don't know where I am creating a second workspace. I only see one 'test.createWorkspace()' inside the suite.setup() funciton. I originally changed the 'prj' to 'prj1' just to have numbers on all the prj variables, but have un-done that change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh, entirely my fault. Please disregard. :p

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! This was a good exercise in understanding the testing logic =)

links { "MyProject2" }
dependson { "MyProject3" }

prj2 = test.createproject(wks)
kind "StaticLib"
configuration "Debug"
targetsuffix "-d"
configuration {}

prj3 = test.createproject(wks)
kind "SharedLib"
links { "MyProject2" }
configuration "Debug"
targetsuffix "-d"
configuration {}
end

local function prepare()
Expand All @@ -58,7 +68,7 @@
end

function suite.PBXBuildFile_ListsDependencyTargets_OnSharedLib()
kind "SharedLib"
prj2.kind="SharedLib"
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
Expand Down Expand Up @@ -92,6 +102,20 @@
remoteGlobalIDString = [libMyProject2-d.a:target];
remoteInfo = "libMyProject2-d.a";
};
[MyProject3.xcodeproj:prodprox] /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = [MyProject3.xcodeproj] /* MyProject3.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = [libMyProject3-d.dylib:product];
remoteInfo = "libMyProject3-d.dylib";
};
[MyProject3.xcodeproj:targprox] /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = [MyProject3.xcodeproj] /* MyProject3.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = [libMyProject3-d.dylib:target];
remoteInfo = "libMyProject3-d.dylib";
};
/* End PBXContainerItemProxy section */
]]
end
Expand All @@ -107,19 +131,21 @@
test.capture [[
/* Begin PBXFileReference section */
[MyProject2.xcodeproj] /* libMyProject2-d.a */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject2.xcodeproj"; path = MyProject2.xcodeproj; sourceTree = SOURCE_ROOT; };
[MyProject3.xcodeproj] /* libMyProject3-d.dylib */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject3.xcodeproj"; path = MyProject3.xcodeproj; sourceTree = SOURCE_ROOT; };
[MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end

function suite.PBXFileReference_UsesRelativePaths()
prj.location = "MyProject"
prj2.location = "MyProject2"
prj2.location = ".."
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
[MyProject2.xcodeproj] /* libMyProject2-d.a */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject2.xcodeproj"; path = ../MyProject2.xcodeproj; sourceTree = SOURCE_ROOT; };
[MyProject3.xcodeproj] /* libMyProject3-d.dylib */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject3.xcodeproj"; path = MyProject3.xcodeproj; sourceTree = SOURCE_ROOT; };
[MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
Expand Down Expand Up @@ -148,7 +174,7 @@
end

function suite.PBXFrameworksBuildPhase_ListsDependencies_OnSharedLib()
kind "SharedLib"
prj2.kind="SharedLib"
prepare()
xcode.PBXFrameworksBuildPhase(tr)
test.capture [[
Expand Down Expand Up @@ -182,6 +208,14 @@
name = Products;
sourceTree = "<group>";
};
[MyProject3.xcodeproj:prodgrp] /* Products */ = {
isa = PBXGroup;
children = (
[libMyProject3-d.dylib] /* libMyProject3-d.dylib */,
);
name = Products;
sourceTree = "<group>";
};
[MyProject] /* MyProject */ = {
isa = PBXGroup;
children = (
Expand All @@ -203,6 +237,7 @@
isa = PBXGroup;
children = (
[MyProject2.xcodeproj] /* MyProject2.xcodeproj */,
[MyProject3.xcodeproj] /* MyProject3.xcodeproj */,
);
name = Projects;
sourceTree = "<group>";
Expand Down Expand Up @@ -233,6 +268,7 @@
);
dependencies = (
[MyProject2.xcodeproj:targdep] /* PBXTargetDependency */,
[MyProject3.xcodeproj:targdep] /* PBXTargetDependency */,
);
name = MyProject;
productInstallPath = "$(HOME)/bin";
Expand Down Expand Up @@ -266,6 +302,10 @@
ProductGroup = [MyProject2.xcodeproj:prodgrp] /* Products */;
ProjectRef = [MyProject2.xcodeproj] /* MyProject2.xcodeproj */;
},
{
ProductGroup = [MyProject3.xcodeproj:prodgrp] /* Products */;
ProjectRef = [MyProject3.xcodeproj] /* MyProject3.xcodeproj */;
},
);
projectRoot = "";
targets = (
Expand Down Expand Up @@ -293,6 +333,13 @@
remoteRef = [MyProject2.xcodeproj:prodprox] /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
[libMyProject3-d.dylib] /* libMyProject3-d.dylib */ = {
isa = PBXReferenceProxy;
fileType = "compiled.mach-o.dylib";
path = "libMyProject3-d.dylib";
remoteRef = [MyProject3.xcodeproj:prodprox] /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
]]
end
Expand All @@ -312,6 +359,11 @@
name = "libMyProject2-d.a";
targetProxy = [MyProject2.xcodeproj:targprox] /* PBXContainerItemProxy */;
};
[MyProject3.xcodeproj:targdep] /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "libMyProject3-d.dylib";
targetProxy = [MyProject3.xcodeproj:targprox] /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
]]
end
Loading