Skip to content

Commit

Permalink
Correct build scheme and tests for tvOS target
Browse files Browse the repository at this point in the history
  • Loading branch information
mac-cain13 committed Mar 28, 2016
1 parent ec2adb6 commit 0568eb7
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ xcuserdata
ResourceApp/rswift
R.generated.swift
ResourceApp/rswift.log
ResourceApp/rswift-tv.log
Pods
24 changes: 18 additions & 6 deletions ResourceApp/ResourceApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@
D5B799871C1B8DD2009EA901 /* Specials.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D5B799861C1B8DD2009EA901 /* Specials.storyboard */; };
D5BA2E5F1C90086C0025C9E3 /* CellCollectionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5BA2E5E1C90086C0025C9E3 /* CellCollectionView.xib */; };
D5CBCE491B7682B800C5D96B /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CBCE481B7682B800C5D96B /* MyViewController.swift */; };
D5CE930D1CA966D9009D0E62 /* rswift-tv.log in Resources */ = {isa = PBXBuildFile; fileRef = D5CE930C1CA966D9009D0E62 /* rswift-tv.log */; };
D5CE930E1CA96714009D0E62 /* ImagesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5EB326D1B63AD6B005C7B47 /* ImagesTests.swift */; };
D5DE480E1B5E1CC7000F6A85 /* R.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DE480D1B5E1CC7000F6A85 /* R.generated.swift */; };
D5E513BA1B8E111A0035ECAA /* AveriaLibre-B.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5E513B51B8E111A0035ECAA /* AveriaLibre-B.ttf */; };
D5E513BB1B8E111A0035ECAA /* AveriaLibre-BI.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5E513B61B8E111A0035ECAA /* AveriaLibre-BI.ttf */; };
D5E513BC1B8E111A0035ECAA /* AveriaLibre-L.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5E513B71B8E111A0035ECAA /* AveriaLibre-L.ttf */; };
D5E513BD1B8E111A0035ECAA /* AveriaLibre.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5E513B81B8E111A0035ECAA /* AveriaLibre.ttf */; };
D5E513BE1B8E111A0035ECAA /* GdyBkltter1911.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5E513B91B8E111A0035ECAA /* GdyBkltter1911.ttf */; };
D5E513C01B8E11810035ECAA /* FontsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E513BF1B8E11810035ECAA /* FontsTests.swift */; };
D5EB326F1B63AD6B005C7B47 /* ImagesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5EB326D1B63AD6B005C7B47 /* ImagesTests.swift */; };
D5EB32701B63AD6B005C7B47 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5EB326E1B63AD6B005C7B47 /* ValidationTests.swift */; };
D5F05D3F1BB3CDF3003AE55E /* The App Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = D5F05D3E1BB3CDF3003AE55E /* The App Icon.png */; };
D5F05D421BB52002003AE55E /* Some.json in Resources */ = {isa = PBXBuildFile; fileRef = D5F05D411BB52002003AE55E /* Some.json */; };
Expand Down Expand Up @@ -126,14 +127,15 @@
D5B799881C1B8F0C009EA901 /* AVKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVKit.framework; path = System/Library/Frameworks/AVKit.framework; sourceTree = SDKROOT; };
D5BA2E5E1C90086C0025C9E3 /* CellCollectionView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CellCollectionView.xib; sourceTree = "<group>"; };
D5CBCE481B7682B800C5D96B /* MyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyViewController.swift; sourceTree = "<group>"; };
D5CE930C1CA966D9009D0E62 /* rswift-tv.log */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "rswift-tv.log"; sourceTree = SOURCE_ROOT; };
D5DE480D1B5E1CC7000F6A85 /* R.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = R.generated.swift; sourceTree = SOURCE_ROOT; };
D5E513B51B8E111A0035ECAA /* AveriaLibre-B.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "AveriaLibre-B.ttf"; sourceTree = "<group>"; };
D5E513B61B8E111A0035ECAA /* AveriaLibre-BI.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "AveriaLibre-BI.ttf"; sourceTree = "<group>"; };
D5E513B71B8E111A0035ECAA /* AveriaLibre-L.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "AveriaLibre-L.ttf"; sourceTree = "<group>"; };
D5E513B81B8E111A0035ECAA /* AveriaLibre.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = AveriaLibre.ttf; sourceTree = "<group>"; };
D5E513B91B8E111A0035ECAA /* GdyBkltter1911.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = GdyBkltter1911.ttf; sourceTree = "<group>"; };
D5E513BF1B8E11810035ECAA /* FontsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontsTests.swift; sourceTree = "<group>"; };
D5EB326D1B63AD6B005C7B47 /* ImagesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImagesTests.swift; sourceTree = "<group>"; };
D5EB326D1B63AD6B005C7B47 /* ImagesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImagesTests.swift; path = ../ResourceAppTests/ImagesTests.swift; sourceTree = "<group>"; };
D5EB326E1B63AD6B005C7B47 /* ValidationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationTests.swift; sourceTree = "<group>"; };
D5F05D3E1BB3CDF3003AE55E /* The App Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "The App Icon.png"; sourceTree = "<group>"; };
D5F05D411BB52002003AE55E /* Some.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Some.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -297,7 +299,6 @@
E24720CD1C96B71B00DF291D /* ColorsTests.swift */,
D5F05D471BB520B1003AE55E /* FilesTests.swift */,
D5E513BF1B8E11810035ECAA /* FontsTests.swift */,
D5EB326D1B63AD6B005C7B47 /* ImagesTests.swift */,
D51F47221B8FAF9F0028BAFD /* NibTests.swift */,
D55C6CD51B5D757300301B0D /* ResourceAppTests.swift */,
D56DC76F1C42A5E700623437 /* StoryboardTests.swift */,
Expand All @@ -316,6 +317,15 @@
name = "Supporting Files";
sourceTree = "<group>";
};
D5CE930B1CA966C6009D0E62 /* Supporting Files */ = {
isa = PBXGroup;
children = (
D5CE930C1CA966D9009D0E62 /* rswift-tv.log */,
DEF559AF1CA48892009B8C51 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
D5E513B41B8E10F90035ECAA /* Fonts */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -354,7 +364,8 @@
isa = PBXGroup;
children = (
DEF559AD1CA48892009B8C51 /* ResourceAppTests_tvOS.swift */,
DEF559AF1CA48892009B8C51 /* Info.plist */,
D5EB326D1B63AD6B005C7B47 /* ImagesTests.swift */,
D5CE930B1CA966C6009D0E62 /* Supporting Files */,
);
path = "ResourceAppTests-tvOS";
sourceTree = "<group>";
Expand Down Expand Up @@ -559,6 +570,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5CE930D1CA966D9009D0E62 /* rswift-tv.log in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -636,7 +648,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/rswift\" \"$SRCROOT/ResourceApp-tvOS\"";
shellScript = "\"$SRCROOT/rswift\" \"$SRCROOT/ResourceApp-tvOS\" > \"$SRCROOT/rswift-tv.log\"";
};
/* End PBXShellScriptBuildPhase section */

Expand All @@ -660,7 +672,6 @@
D5E513C01B8E11810035ECAA /* FontsTests.swift in Sources */,
E24720CE1C96B71B00DF291D /* ColorsTests.swift in Sources */,
D56DC7701C42A5E700623437 /* StoryboardTests.swift in Sources */,
D5EB326F1B63AD6B005C7B47 /* ImagesTests.swift in Sources */,
D51F47231B8FAF9F0028BAFD /* NibTests.swift in Sources */,
D55C6CD61B5D757300301B0D /* ResourceAppTests.swift in Sources */,
D5EB32701B63AD6B005C7B47 /* ValidationTests.swift in Sources */,
Expand All @@ -682,6 +693,7 @@
buildActionMask = 2147483647;
files = (
DEF559AE1CA48892009B8C51 /* ResourceAppTests_tvOS.swift in Sources */,
D5CE930E1CA96714009D0E62 /* ImagesTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D5EA0DF31A3DF45600FFEBC4"
BuildableName = "rswift"
BlueprintName = "rswift"
ReferencedContainer = "container:../R.swift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DEF559961CA4873D009B8C51"
BuildableName = "ResourceApp-tvOS.app"
BlueprintName = "ResourceApp-tvOS"
ReferencedContainer = "container:ResourceApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DEF559AA1CA48892009B8C51"
BuildableName = "ResourceAppTests-tvOS.xctest"
BlueprintName = "ResourceAppTests-tvOS"
ReferencedContainer = "container:ResourceApp.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DEF559961CA4873D009B8C51"
BuildableName = "ResourceApp-tvOS.app"
BlueprintName = "ResourceApp-tvOS"
ReferencedContainer = "container:ResourceApp.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DEF559961CA4873D009B8C51"
BuildableName = "ResourceApp-tvOS.app"
BlueprintName = "ResourceApp-tvOS"
ReferencedContainer = "container:ResourceApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DEF559961CA4873D009B8C51"
BuildableName = "ResourceApp-tvOS.app"
BlueprintName = "ResourceApp-tvOS"
ReferencedContainer = "container:ResourceApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
28 changes: 24 additions & 4 deletions ResourceApp/ResourceAppTests-tvOS/ResourceAppTests_tvOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,29 @@
import XCTest

class ResourceAppTests_tvOS: XCTestCase {

func testNonNilImages() {
XCTAssertNotNil(R.image.imageStackAsset())

let expectedWarnings = [
""
]

func testWarningsAreLogged() {
guard let logURL = NSBundle(forClass: ResourceAppTests_tvOS.self).URLForResource("rswift-tv", withExtension: "log") else {
XCTFail("File rswift.log not found")
return
}

do {
let logContent = try String(contentsOfURL: logURL)
let logLines = logContent.componentsSeparatedByString("\n")

for warning in expectedWarnings {
XCTAssertTrue(logLines.contains(warning), "Warning is not logged: '\(warning)'")
}

XCTAssertEqual(logLines.count, expectedWarnings.count, "There are more/less warnings then expected")

} catch {
XCTFail("Failed to read rswift.log")
}
}

}
15 changes: 3 additions & 12 deletions ResourceApp/ResourceAppTests/ImagesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,11 @@

import UIKit
import XCTest
@testable import ResourceApp
@testable import ResourceApp_tvOS

class ImagesTests: XCTestCase {

func testNoNilAssetImages() {
XCTAssertNotNil(R.image.eerste())
XCTAssertNotNil(R.image.first())
XCTAssertNotNil(R.image.firstNested())
XCTAssertNotNil(R.image.secondNested())
XCTAssertNotNil(R.image.skyTiff())
}

func testNoNilFilebasedImages() {
XCTAssertNotNil(R.image.colorsJpg())
XCTAssertNotNil(R.image.userWhite())
func testNonNilImages() {
XCTAssertNotNil(R.image.imageStackAsset())
}
}

0 comments on commit 0568eb7

Please sign in to comment.