From 086852f073551a303eec5987ae76007cfe70ce5d Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 12 Sep 2016 17:26:10 -1000 Subject: [PATCH] Fix Cartfile; Fix Travis; Fix tests --- .travis.yml | 25 ++++++++++++++++++++----- Cartfile | 2 +- Tests/TestAlamofire.swift | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7880e7a..e36c0bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,28 @@ language: objective-c osx_image: xcode8 env: - - PLATFORM=Mac ACTION=test DESTINATION='platform=OS X' - - PLATFORM=iOS ACTION=test DESTINATION='platform=iOS Simulator,name=iPhone 6S' - - PLATFORM=watchOS ACTION=build DESTINATION='platform=watchOS Simulator,name=Apple Watch - 38mm' - - PLATFORM=tvOS ACTION=test DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p' + - PLATFORM=Mac + - PLATFORM=iOS NAME='iPhone SE' + - PLATFORM=tvOS NAME='Apple TV 1080p' + - PLATFORM=watchOS + +before_install: + - if [ -n "$NAME" ]; then + export UUID=$(instruments -s | ruby -e "ARGF.each_line{ |ln| ln =~ /$NAME .* \[(.*)\]/; if \$1; puts(\$1); exit; end }"); + fi install: - carthage bootstrap --platform $PLATFORM script: - - set -o pipefail && xcodebuild -scheme PMKAlamofire -destination "$DESTINATION" $ACTION | xcpretty + - set -o pipefail; + case $PLATFORM in + Mac) + xcodebuild -scheme PMKAlamofire test | xcpretty;; + iOS|tvOS) + xcrun instruments -w "$UUID" || true; + sleep 15; + xcodebuild -scheme PMKAlamofire -destination "id=$UUID" test | xcpretty;; + watchOS) + xcodebuild -scheme PMKAlamofire -destination "name=Apple Watch - 38mm" | xcpretty;; + esac diff --git a/Cartfile b/Cartfile index fdb4700..6bbaa25 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ github "mxcl/PromiseKit" ~> 4.0 -github "Alamofire/Alamofire" "swift3" +github "Alamofire/Alamofire" ~> 4.0 diff --git a/Tests/TestAlamofire.swift b/Tests/TestAlamofire.swift index e6422b6..5310b86 100644 --- a/Tests/TestAlamofire.swift +++ b/Tests/TestAlamofire.swift @@ -13,7 +13,7 @@ class AlamofireTests: XCTestCase { let ex = expectation(description: "") - let rq = Alamofire.request("http://example.com", withMethod: .get).responseJSON().then { rsp -> Void in + let rq = Alamofire.request("http://example.com", method: .get).responseJSON().then { rsp -> Void in XCTAssertEqual(json, rsp as? NSDictionary) ex.fulfill() }