From 8472801c4ba24b64c4c4d4b01ef2cfb7a30810a3 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sun, 30 Sep 2018 14:50:15 -0600 Subject: [PATCH] fix link error when launching SSK tests --- SignalServiceKit/tests/SSKSwiftTests.swift | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/SignalServiceKit/tests/SSKSwiftTests.swift b/SignalServiceKit/tests/SSKSwiftTests.swift index 9ebb6c5b5..60d8d3aee 100644 --- a/SignalServiceKit/tests/SSKSwiftTests.swift +++ b/SignalServiceKit/tests/SSKSwiftTests.swift @@ -4,6 +4,10 @@ import XCTest +///// +// Swift Test vs. Cocoapods issue #1 +///// +// // Cocoapods-generated test targets (like this one) // fail to link if: // @@ -14,3 +18,23 @@ import XCTest // to our test target. // // See: https://github.com/CocoaPods/CocoaPods/issues/7170 + +///// +// Swift Test vs. Cocoapods issue #2 +///// +// +// XCode's test runner doesn't copy swift framework's required by dependencies into +// the running test bundle. +// It sounds similar to this issue: https://github.com/CocoaPods/CocoaPods/issues/7985 +// +// The error output looks like this: +// The bundle “SignalServiceKit-Unit-Tests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. +// [...]/SignalServiceKit-Unit-Tests.xctest/SignalServiceKit-Unit-Tests): Library not loaded: @rpath/libswiftAVFoundation.dylib +// Referenced from: /Users/[...]/Build/Products/Debug-iphonesimulator/SignalServiceKit/SignalServiceKit.framework/SignalServiceKit +// Reason: image not found) +// Program ended with exit code: 82 +// +// A work around is to redundantly import any swift frameworks used by the dependencies of the test suite into this test file. +// The error message provides a hint, i.e. "Library not loaded: @rpath/libswiftAVFoundation.dylib" is fixed with `import AVFoundation` +import AVFoundation +import CloudKit