Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
9b78482a
Commit
9b78482a
authored
Mar 19, 2014
by
Piet Brauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert indention into spaces instead of tabs
parent
a88e48f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
85 deletions
+85
-85
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+85
-85
No files found.
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
9b78482a
...
...
@@ -50,7 +50,7 @@ module Pod
@project
.
targets
.
first
.
name
.
should
==
'Pods-BananaLib'
end
it
"sets VALIDATE_PRODUCT to YES for the Release configuration for iOS targets"
do
it
"sets VALIDATE_PRODUCT to YES for the Release configuration for iOS targets"
do
@installer
.
install!
target
=
@project
.
targets
.
first
target
.
build_settings
(
'Release'
)[
"VALIDATE_PRODUCT"
].
should
==
"YES"
...
...
@@ -147,91 +147,91 @@ module Pod
dummy
=
config
.
sandbox
.
root
+
'Pods-BananaLib-dummy.m'
dummy
.
read
.
should
.
include?
(
'@interface PodsDummy_Pods'
)
end
#--------------------------------------------------------------------------------#
describe
"concerning compiler flags"
do
before
do
@spec
=
Pod
::
Spec
.
new
end
it
"flags should not be added to dtrace files"
do
@installer
.
library
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
@installer
.
install!
dtrace_files
=
@installer
.
library
.
target
.
source_build_phase
.
files
.
reject
{
|
sf
|
!
(
File
.
extname
(
sf
.
file_ref
.
path
)
==
'.d'
)
}
dtrace_files
.
each
do
|
dt
|
dt
.
settings
.
should
.
be
.
nil
end
end
it
"adds -w per pod if target definition inhibits warnings for that pod"
do
@installer
.
library
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
include?
(
'-w'
)
end
it
"doesn't inhibit warnings by default"
do
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
not
.
include?
(
'-w'
)
end
it
"adds -Xanalyzer -analyzer-disable-checker per pod"
do
@installer
.
library
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
include?
(
'-Xanalyzer -analyzer-disable-checker'
)
end
it
"doesn't inhibit analyzer warnings by default"
do
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
not
.
include?
(
'-Xanalyzer -analyzer-disable-checker'
)
end
describe
"concerning ARC before and after iOS 6.0 and OS X 10.8"
do
it
"does not do anything if ARC is *not* required"
do
@spec
.
requires_arc
=
false
@spec
.
ios
.
deployment_target
=
'5'
@spec
.
osx
.
deployment_target
=
'10.6'
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
end
it
"does *not* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and has a deployment target of >= iOS 6.0 or OS X 10.8"
do
@spec
.
requires_arc
=
false
@spec
.
ios
.
deployment_target
=
'6'
@spec
.
osx
.
deployment_target
=
'10.8'
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
end
it
"*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required but has a deployment target < iOS 6.0 or OS X 10.8"
do
@spec
.
requires_arc
=
true
@spec
.
ios
.
deployment_target
=
'5.1'
@spec
.
osx
.
deployment_target
=
'10.7.2'
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
end
it
"*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and *no* deployment target is specified"
do
@spec
.
requires_arc
=
true
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
end
end
end
describe
"concerning compiler flags"
do
before
do
@spec
=
Pod
::
Spec
.
new
end
it
"flags should not be added to dtrace files"
do
@installer
.
library
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
@installer
.
install!
dtrace_files
=
@installer
.
library
.
target
.
source_build_phase
.
files
.
reject
{
|
sf
|
!
(
File
.
extname
(
sf
.
file_ref
.
path
)
==
'.d'
)
}
dtrace_files
.
each
do
|
dt
|
dt
.
settings
.
should
.
be
.
nil
end
end
it
"adds -w per pod if target definition inhibits warnings for that pod"
do
@installer
.
library
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
include?
(
'-w'
)
end
it
"doesn't inhibit warnings by default"
do
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
not
.
include?
(
'-w'
)
end
it
"adds -Xanalyzer -analyzer-disable-checker per pod"
do
@installer
.
library
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
include?
(
'-Xanalyzer -analyzer-disable-checker'
)
end
it
"doesn't inhibit analyzer warnings by default"
do
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
flags
.
should
.
not
.
include?
(
'-Xanalyzer -analyzer-disable-checker'
)
end
describe
"concerning ARC before and after iOS 6.0 and OS X 10.8"
do
it
"does not do anything if ARC is *not* required"
do
@spec
.
requires_arc
=
false
@spec
.
ios
.
deployment_target
=
'5'
@spec
.
osx
.
deployment_target
=
'10.6'
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
end
it
"does *not* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and has a deployment target of >= iOS 6.0 or OS X 10.8"
do
@spec
.
requires_arc
=
false
@spec
.
ios
.
deployment_target
=
'6'
@spec
.
osx
.
deployment_target
=
'10.8'
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
not
.
include
'-DOS_OBJECT_USE_OBJC'
end
it
"*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required but has a deployment target < iOS 6.0 or OS X 10.8"
do
@spec
.
requires_arc
=
true
@spec
.
ios
.
deployment_target
=
'5.1'
@spec
.
osx
.
deployment_target
=
'10.7.2'
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
end
it
"*does* disable the `OS_OBJECT_USE_OBJC` flag if ARC is required and *no* deployment target is specified"
do
@spec
.
requires_arc
=
true
ios_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
))
osx_flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:osx
))
ios_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
osx_flags
.
should
.
include
'-DOS_OBJECT_USE_OBJC'
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment