Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Run tests under Xcode 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtremeMan committed Aug 22, 2016
1 parent faca616 commit eabc714
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buckversion
@@ -1 +1 @@
ecae40a002b06f609817a5be87a8ebb34ae44a7c
e3c0eab936b0e9bc90c8ca1f4e019f6f40827922
11 changes: 6 additions & 5 deletions .travis.yml
@@ -1,8 +1,9 @@
osx_image: xcode7.3
language: objective-c
before_script:
- sudo brew tap caskroom/cask
- sudo brew tap caskroom/versions
- sudo brew update
- sudo brew cask install java7
- sudo brew install ant
- brew tap caskroom/cask
- brew tap caskroom/versions
- brew update
- brew cask install java7
- brew install ant
script: ./scripts/travis-ci.sh
2 changes: 1 addition & 1 deletion scripts/travis-ci.sh
Expand Up @@ -6,7 +6,7 @@ set -x
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)

# Build xctool with xcodebuild
scripts/build.sh && ./xctool.sh -workspace xctool.xcworkspace -scheme xctool build build-tests run-tests
./xctool.sh -workspace xctool.xcworkspace -scheme xctool test

# Fetch latest upstream Buck version
git clone https://github.com/facebook/buck.git Vendor/buck
Expand Down
7 changes: 4 additions & 3 deletions xctool/xctool-tests/SimulatorWrapperTests.m
Expand Up @@ -23,6 +23,7 @@
#import "SimulatorWrapper.h"
#import "SimulatorWrapperXcode6.h"
#import "Swizzler.h"
#import "XCToolUtil.h"

@interface SimulatorWrapperTests : XCTestCase
{
Expand Down Expand Up @@ -192,7 +193,7 @@ - (void)testUninstallTestHostBundleIDTimesOut
NSString *testHostBundleID = @"com.facebook.xctool-test-app";
NSString *error = nil;
[_simDevice addFakeInstalledApp:testHostBundleID];
_simDevice.fakeUninstallTimeout = 20;
_simDevice.fakeUninstallTimeout = IsRunningOnCISystem() ? 60 : 20;
BOOL result = [SimulatorWrapper uninstallTestHostBundleID:testHostBundleID
device:_simDevice
reporters:@[_eventBuffer]
Expand All @@ -211,7 +212,7 @@ - (void)testUninstallTestHostBundleIDTimesOutOnIsInstallCheck
NSString *testHostBundleID = @"com.facebook.xctool-test-app";
NSString *error = nil;
[_simDevice addFakeInstalledApp:testHostBundleID];
_simDevice.fakeIsInstalledTimeout = 20;
_simDevice.fakeIsInstalledTimeout = IsRunningOnCISystem() ? 60 : 20;
BOOL result = [SimulatorWrapper uninstallTestHostBundleID:testHostBundleID
device:_simDevice
reporters:@[_eventBuffer]
Expand Down Expand Up @@ -271,7 +272,7 @@ - (void)testInstallTestHostBundleIDTimesOut
NSString *testHostBundleID = @"com.facebook.xctool-test-app";
NSString *error = nil;
_simDevice.fakeInstallFailure = YES;
_simDevice.fakeInstallTimeout = 20;
_simDevice.fakeInstallTimeout = IsRunningOnCISystem() ? 60 : 20;
BOOL result = [SimulatorWrapper installTestHostBundleID:testHostBundleID
fromBundlePath:@"/tmp"
device:_simDevice
Expand Down
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CCB720D51C72AED100600490"
BuildableName = "TestProjectTVFramework.framework"
BlueprintName = "TestProjectTVFramework"
ReferencedContainer = "container:TestProject-TVFramework.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 = "CCB720DF1C72AED100600490"
BuildableName = "TestProject-TVFrameworkTests.xctest"
BlueprintName = "TestProject-TVFrameworkTests"
ReferencedContainer = "container:TestProject-TVFramework.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CCB720D51C72AED100600490"
BuildableName = "TestProjectTVFramework.framework"
BlueprintName = "TestProjectTVFramework"
ReferencedContainer = "container:TestProject-TVFramework.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">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CCB720D51C72AED100600490"
BuildableName = "TestProjectTVFramework.framework"
BlueprintName = "TestProjectTVFramework"
ReferencedContainer = "container:TestProject-TVFramework.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CCB720D51C72AED100600490"
BuildableName = "TestProjectTVFramework.framework"
BlueprintName = "TestProjectTVFramework"
ReferencedContainer = "container:TestProject-TVFramework.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion xctool/xctool/SimulatorWrapper/SimulatorUtils.m
Expand Up @@ -206,7 +206,7 @@ BOOL ShutdownSimulator(SimulatorInfo *simulatorInfo, NSString **errorMessage)

BOOL RunSimulatorBlockWithTimeout(dispatch_block_t block)
{
dispatch_time_t timeout = IsRunningUnderTest() ? 5 : kDefaultSimulatorBlockTimeout;
dispatch_time_t timeout = (IsRunningUnderTest() && !IsRunningOnCISystem()) ? 5 : kDefaultSimulatorBlockTimeout;
dispatch_time_t timer = dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC);
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
Expand Down

0 comments on commit eabc714

Please sign in to comment.