Skip to content

Commit

Permalink
Merge pull request #1400 from smartdevicelink/bugfix/issue_1399_travi…
Browse files Browse the repository at this point in the history
…s_fail

Updating travis.yml to use iOS 12.4
  • Loading branch information
joeljfischer authored Sep 19, 2019
2 parents 616e704 + eda9139 commit 0e7d70b
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 24 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: objective-c
osx_image: xcode10.2
osx_image: xcode10.3
xcode_project: SmartDeviceLink-iOS.xcodeproj
xcode_scheme: SmartDeviceLink
xcode_sdk: iphonesimulator12.0
xcode_sdk: iphonesimulator12.4
env:
global:
- FRAMEWORK_NAME=SmartDeviceLink
Expand All @@ -18,8 +18,9 @@ before_script:
- carthage bootstrap --platform ios

script:
- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator11.0" -destination "OS=11.0,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c;
- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example" -sdk "iphonesimulator11.0" -destination "OS=11.0,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone Xs" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c;
- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-ObjC" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone Xs" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-Swift" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone Xs" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;

after_script:
- bash <(curl -s https://codecov.io/bash)
Expand Down
4 changes: 2 additions & 2 deletions SmartDeviceLink/SDLLockScreenConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (instancetype)initWithDisplayMode:(SDLLockScreenConfigurationDisplayMode)mode

_displayMode = mode;
_enableAutomaticLockScreen = (mode == SDLLockScreenConfigurationDisplayModeNever) ? NO : YES;
_showInOptionalState = (mode == SDLLockScreenConfigurationDisplayModeOptionalOrRequired) ? NO : YES;
_showInOptionalState = (mode == SDLLockScreenConfigurationDisplayModeOptionalOrRequired) ? YES : NO;

_enableDismissGesture = enableDismissGesture;
_backgroundColor = backgroundColor;
Expand All @@ -35,7 +35,7 @@ - (instancetype)initWithDisplayMode:(SDLLockScreenConfigurationDisplayMode)mode
}

+ (instancetype)disabledConfiguration {
return [[self alloc] initWithDisplayMode:SDLLockScreenConfigurationDisplayModeNever enableDismissGesture:NO showDeviceLogo:YES backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil];
return [[self alloc] initWithDisplayMode:SDLLockScreenConfigurationDisplayModeNever enableDismissGesture:NO showDeviceLogo:NO backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil];
}

+ (instancetype)enabledConfiguration {
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ @implementation FileManagerSpecHelper
[testFileManager uploadArtworks:testArtworks progressHandler:^BOOL(NSString * _Nonnull artworkName, float uploadPercentage, NSError * _Nullable error) {
artworksDone++;
expect(artworkName).to(equal(expectedArtworkNames[artworksDone - 1]));
expect(uploadPercentage).to(beCloseTo((float)artworksDone / 200.0));
expect(uploadPercentage).to(beCloseTo((float)artworksDone / 200.0).within(0.1));
expect(error).to(beNil());
return YES;
} completionHandler:^(NSArray<NSString *> * _Nonnull artworkNames, NSError * _Nullable error) {
Expand Down
12 changes: 12 additions & 0 deletions SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
});

it(@"should properly set properties", ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
expect(testConfig.enableAutomaticLockScreen).to(beFalse());
expect(testConfig.showInOptionalState).to(beFalse());
#pragma clang diagnostic pop
expect(testConfig.enableDismissGesture).to(beFalse());
expect(testConfig.showDeviceLogo).to(beFalse());
expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0]));
Expand All @@ -30,8 +33,11 @@
});

it(@"should properly set properties", ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
expect(testConfig.enableAutomaticLockScreen).to(beTrue());
expect(testConfig.showInOptionalState).to(beFalse());
#pragma clang diagnostic pop
expect(testConfig.enableDismissGesture).to(beTrue());
expect(testConfig.showDeviceLogo).to(beTrue());
expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0]));
Expand All @@ -52,8 +58,11 @@
});

it(@"should properly set properties", ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
expect(testConfig.enableAutomaticLockScreen).to(beTrue());
expect(testConfig.showInOptionalState).to(beFalse());
#pragma clang diagnostic pop
expect(testConfig.enableDismissGesture).to(beTrue());
expect(testConfig.showDeviceLogo).to(beTrue());
expect(testConfig.backgroundColor).to(equal([UIColor blueColor]));
Expand All @@ -72,8 +81,11 @@
});

it(@"should properly set properties", ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
expect(testConfig.enableAutomaticLockScreen).to(beTrue());
expect(testConfig.showInOptionalState).to(beFalse());
#pragma clang diagnostic pop
expect(testConfig.enableDismissGesture).to(beTrue());
expect(testConfig.showDeviceLogo).to(beTrue());
expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0]));
Expand Down
6 changes: 3 additions & 3 deletions SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,18 @@ @interface SDLMenuManager()
});
});

describe(@"Notificaiton Responses", ^{
describe(@"Notification Responses", ^{
it(@"should set display capabilities when SDLDidReceiveSetDisplayLayoutResponse is received", ^{
testDisplayCapabilities = [[SDLDisplayCapabilities alloc] init];

testSetDisplayLayoutResponse = [[SDLSetDisplayLayoutResponse alloc] init];
testSetDisplayLayoutResponse.success = @YES;
testSetDisplayLayoutResponse.displayCapabilities = testDisplayCapabilities;

SDLRPCResponseNotification *notification = [[SDLRPCResponseNotification alloc] initWithName:SDLDidReceiveRegisterAppInterfaceResponse object:self rpcResponse:testSetDisplayLayoutResponse];
SDLRPCResponseNotification *notification = [[SDLRPCResponseNotification alloc] initWithName:SDLDidReceiveSetDisplayLayoutRequest object:self rpcResponse:testSetDisplayLayoutResponse];
[[NSNotificationCenter defaultCenter] postNotification:notification];

expect(testManager.displayCapabilities).to(equal(testDisplayCapabilities));
expect(testManager.displayCapabilities).withTimeout(3).toEventually(equal(testDisplayCapabilities));
});

it(@"should set display capabilities when SDLDidReceiveRegisterAppInterfaceResponse is received", ^{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
__block NSError *resultError = nil;

beforeEach(^{
testOp = nil;
resultError = nil;
hasCalledOperationCompletionHandler = NO;

Expand Down Expand Up @@ -403,12 +404,10 @@
[testOp dismissKeyboard];
});

it(@"should not attempt to send a cancel interaction", ^{
it(@"should not finish or send a cancel interaction", ^{
SDLCancelInteraction *lastRequest = testConnectionManager.receivedRequests.lastObject;
expect(lastRequest).toNot(beAnInstanceOf([SDLCancelInteraction class]));
});

it(@"should not finish", ^{
expect(hasCalledOperationCompletionHandler).toEventually(beFalse());
expect(testOp.isExecuting).toEventually(beTrue());
expect(testOp.isFinished).toEventually(beFalse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel, SDLVideoStream

it(@"should have set all the right properties", ^{
expect([[SDLGlobals sharedGlobals] mtuSizeForServiceType:SDLServiceTypeVideo]).to(equal(testMTU));
expect(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeMake(testVideoWidth, testVideoHeight))).to(equal(YES));
expect(@(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeMake(testVideoWidth, testVideoHeight)))).to(beTrue());
expect(streamingLifecycleManager.videoEncrypted).to(equal(YES));
expect(streamingLifecycleManager.videoFormat).to(equal([[SDLVideoStreamingFormat alloc] initWithCodec:testVideoCodec protocol:testVideoProtocol]));
expect(streamingLifecycleManager.currentVideoStreamState).to(equal(SDLVideoStreamManagerStateReady));
Expand All @@ -539,7 +539,7 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel, SDLVideoStream
});

it(@"should fall back correctly", ^{
expect(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeMake(testVideoWidth, testVideoHeight))).to(equal(YES));
expect(@(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeMake(testVideoWidth, testVideoHeight)))).to(beTrue());
expect(streamingLifecycleManager.videoFormat).to(equal([[SDLVideoStreamingFormat alloc] initWithCodec:SDLVideoStreamingCodecH264 protocol:SDLVideoStreamingProtocolRAW]));
expect(streamingLifecycleManager.currentVideoStreamState).to(equal(SDLVideoStreamManagerStateReady));
});
Expand All @@ -551,14 +551,8 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel, SDLVideoStream


beforeEach(^{
preferredResolutionLow = [[SDLImageResolution alloc] initWithWidth:10 height:10];
preferredResolutionHigh = [[SDLImageResolution alloc] initWithWidth:100 height:100];
streamingLifecycleManager.preferredResolutions = @[preferredResolutionLow, preferredResolutionHigh];

testVideoStartServicePayload = [[SDLControlFramePayloadVideoStartServiceAck alloc] initWithMTU:testMTU height:SDLControlFrameInt32NotFound width:SDLControlFrameInt32NotFound protocol:nil codec:nil];
testVideoMessage = [[SDLV2ProtocolMessage alloc] initWithHeader:testVideoHeader andPayload:testVideoStartServicePayload.data];

expect(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeZero));
});

context(@"If the data source is nil", ^{
Expand All @@ -568,20 +562,24 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel, SDLVideoStream
});

it(@"should not replace the existing screen resolution", ^{
expect(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeZero));
expect(@(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeZero))).to(beTrue());
expect(streamingLifecycleManager.dataSource).to(beNil());
});
});

context(@"If the preferred resolution was set in the data source", ^{
beforeEach(^{
preferredResolutionLow = [[SDLImageResolution alloc] initWithWidth:10 height:10];
preferredResolutionHigh = [[SDLImageResolution alloc] initWithWidth:100 height:100];
streamingLifecycleManager.preferredResolutions = @[preferredResolutionLow, preferredResolutionHigh];

streamingLifecycleManager.dataSource = testDataSource;
[streamingLifecycleManager handleProtocolStartServiceACKMessage:testVideoMessage];
});

it(@"should set the screen size using the first provided preferred resolution", ^{
CGSize preferredFormat = CGSizeMake(preferredResolutionLow.resolutionWidth.floatValue, preferredResolutionLow.resolutionHeight.floatValue);
expect(CGSizeEqualToSize(streamingLifecycleManager.screenSize, preferredFormat));
expect(@(CGSizeEqualToSize(streamingLifecycleManager.screenSize, preferredFormat))).to(beTrue());
expect(streamingLifecycleManager.dataSource).toNot(beNil());
});
});
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ...ollerSnapshotTests/[email protected]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion SmartDeviceLinkTests/SDLAsynchronousRPCOperationSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
[testOperationQueue addOperation:testOperation];
[testOperationQueue cancelAllOperations];

[NSThread sleepForTimeInterval:0.1];
[NSThread sleepForTimeInterval:0.5];

expect(testConnectionManager.receivedRequests).toEventually(beEmpty());
});
Expand Down

0 comments on commit 0e7d70b

Please sign in to comment.