Skip to content

Commit

Permalink
fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
renep committed Aug 8, 2016
1 parent 827b6d1 commit ae7dec8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,20 @@ class XcodeBuildTaskSpecification extends Specification {

def expectedDefaultDirectories() {
return [
"-derivedDataPath", new File(project.buildDir, "derivedData").absolutePath,
"DSTROOT=" + new File(project.buildDir,"dst").absolutePath,
"OBJROOT=" + new File(project.buildDir,"obj").absolutePath,
"SYMROOT=" + new File(project.buildDir,"sym").absolutePath,
"SHARED_PRECOMPS_DIR=" + new File(project.buildDir,"shared").absolutePath
]
}

def expectedDerivedDataPath() {
return [
"-derivedDataPath", new File(project.buildDir, "derivedData").absolutePath
]

}

def createCommand(String... commands) {
def command = []
command.addAll(commands)
Expand All @@ -66,6 +72,7 @@ class XcodeBuildTaskSpecification extends Specification {

def createCommandWithDefaultDirectories(String... commands) {
def command = createCommand(commands)
command.addAll(expectedDerivedDataPath())
command.addAll(expectedDefaultDirectories())
return command
}
Expand Down Expand Up @@ -194,6 +201,7 @@ class XcodeBuildTaskSpecification extends Specification {
"CODE_SIGN_IDENTITY=",
"CODE_SIGNING_REQUIRED=NO"
]
expectedCommandList.addAll(expectedDerivedDataPath())
expectedCommandList.addAll(expectedDefaultDirectories())
}
commandList == expectedCommandList
Expand All @@ -220,6 +228,7 @@ class XcodeBuildTaskSpecification extends Specification {
"CODE_SIGN_IDENTITY=",
"CODE_SIGNING_REQUIRED=NO"
]
expectedCommandList.addAll(expectedDerivedDataPath())
expectedCommandList.addAll(expectedDefaultDirectories())
expectedCommandList << "-destination" << "platform=OS X,arch=x86_64"

Expand Down Expand Up @@ -250,6 +259,7 @@ class XcodeBuildTaskSpecification extends Specification {
"-configuration", "Debug",
"ARCHS=myarch"
]
expectedCommandList.addAll(expectedDerivedDataPath())
expectedCommandList.addAll(expectedDefaultDirectories())
expectedCommandList << "-destination" << "platform=iOS Simulator,id=5F371E1E-AFCE-4589-9158-8C439A468E61"

Expand Down Expand Up @@ -284,6 +294,7 @@ class XcodeBuildTaskSpecification extends Specification {
"CODE_SIGNING_REQUIRED=NO",
"ARCHS=armv armv7s"
]
expectedCommandList.addAll(expectedDerivedDataPath())
expectedCommandList.addAll(expectedDefaultDirectories())
}
commandList == expectedCommandList
Expand All @@ -309,6 +320,7 @@ class XcodeBuildTaskSpecification extends Specification {
"-workspace", 'myworkspace',
"-configuration", "Debug",
]
expectedCommandList.addAll(expectedDerivedDataPath())
expectedCommandList.addAll(expectedDefaultDirectories())
expectedCommandList << "-destination" << "platform=iOS Simulator,id=5F371E1E-AFCE-4589-9158-8C439A468E61"

Expand Down Expand Up @@ -363,6 +375,7 @@ class XcodeBuildTaskSpecification extends Specification {
"-workspace", 'myworkspace',
"-configuration", 'Debug',
]
expectedCommandList.addAll(expectedDerivedDataPath())
expectedCommandList.addAll(expectedDefaultDirectories())
expectedCommandList << "-destination" << "platform=iOS Simulator,id=5F371E1E-AFCE-4589-9158-8C439A468E61"
}
Expand Down Expand Up @@ -392,6 +405,7 @@ class XcodeBuildTaskSpecification extends Specification {
"-configuration", 'Debug',
"ARCHS=i386"
]
expectedCommandList.addAll(expectedDerivedDataPath())
expectedCommandList.addAll(expectedDefaultDirectories())
expectedCommandList << "-destination" << "platform=iOS Simulator,id=5F371E1E-AFCE-4589-9158-8C439A468E61"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,12 @@ class XcodeTestTaskSpecification extends Specification {
"CODE_SIGN_IDENTITY=",
"CODE_SIGNING_REQUIRED=NO",
"-destination",
"platform=OS X,arch=x86_64"]
expectedCommandList.addAll(expectedDefaultDirectories())
"platform=OS X,arch=x86_64",
"DSTROOT=" + new File(project.buildDir, "dst").absolutePath,
"OBJROOT=" + new File(project.buildDir, "obj").absolutePath,
"SYMROOT=" + new File(project.buildDir, "sym").absolutePath,
"SHARED_PRECOMPS_DIR=" + new File(project.buildDir, "shared").absolutePath
]
expectedCommandList << "-enableCodeCoverage" << "yes"
expectedCommandList << "test"
}
Expand Down

0 comments on commit ae7dec8

Please sign in to comment.