session-ios/SignalServiceKit/tests/SSKSwiftTests.swift
2018-11-11 11:13:05 -06:00

40 lines
1.5 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import XCTest
/////
// Swift Test vs. Cocoapods issue #1
/////
//
// Cocoapods-generated test targets (like this one)
// fail to link if:
//
// * They only contain Obj-C tests.
// * They depend on pods that use Swift.
//
// The work around is to add (this) empty swift file
// 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 couldnt 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