Fix test inter-dependencies
Cannot depend on another test target?
This commit is contained in:
parent
d977c3317c
commit
e49e3cad08
|
@ -89,13 +89,11 @@ let package = Package(
|
|||
.testTarget(
|
||||
name: "TunnelKitCoreTests",
|
||||
dependencies: [
|
||||
"TunnelKitCore",
|
||||
"_TunnelKitCoreObjC"
|
||||
"TunnelKitCore"
|
||||
]),
|
||||
.testTarget(
|
||||
name: "TunnelKitOpenVPNTests",
|
||||
dependencies: [
|
||||
"TunnelKitCoreTests",
|
||||
"TunnelKitOpenVPN",
|
||||
"_TunnelKitOpenVPNObjC",
|
||||
"TunnelKitLZO"
|
||||
|
@ -106,6 +104,7 @@ let package = Package(
|
|||
.testTarget(
|
||||
name: "TunnelKitLZOTests",
|
||||
dependencies: [
|
||||
"TunnelKitCore",
|
||||
"TunnelKitLZO"
|
||||
]),
|
||||
]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// DataManipulationTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitCoreTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// RandomTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitCoreTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// RawPerformanceTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitCoreTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// RoutingTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitCoreTests
|
||||
//
|
||||
// Created by Davide De Rosa on 4/30/19.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// TestUtils+Core.swift
|
||||
// TunnelKitTests
|
||||
// TestUtils.swift
|
||||
// TunnelKitCoreTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
@ -38,10 +38,6 @@ import Foundation
|
|||
@testable import TunnelKitCore
|
||||
|
||||
public class TestUtils {
|
||||
public static func uniqArray(_ v: [Int]) -> [Int] {
|
||||
return v.reduce([]){ $0.contains($1) ? $0 : $0 + [$1] }
|
||||
}
|
||||
|
||||
public static func generateDataSuite(_ size: Int, _ count: Int) -> [Data] {
|
||||
var suite = [Data]()
|
||||
for _ in 0..<count {
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// CompressionTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitLZOTests
|
||||
//
|
||||
// Created by Davide De Rosa on 3/18/19.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// AppExtensionTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 10/23/17.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ConfigurationParserTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 11/10/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ControlChannelTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 9/10/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// DataPathEncryptionTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/11/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// DataPathPerformanceTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
@ -38,7 +38,6 @@ import XCTest
|
|||
@testable import TunnelKitCore
|
||||
@testable import TunnelKitOpenVPN
|
||||
import _TunnelKitOpenVPNObjC
|
||||
import TunnelKitCoreTests
|
||||
|
||||
class DataPathPerformanceTests: XCTestCase {
|
||||
private var dataPath: DataPath!
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// EncryptionPerformanceTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
@ -38,7 +38,6 @@ import XCTest
|
|||
@testable import TunnelKitCore
|
||||
import _TunnelKitCoreObjC
|
||||
import _TunnelKitOpenVPNObjC
|
||||
import TunnelKitCoreTests
|
||||
|
||||
class EncryptionPerformanceTests: XCTestCase {
|
||||
private var cbcEncrypter: Encrypter!
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// EncryptionTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// LinkTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
@ -37,7 +37,6 @@
|
|||
import XCTest
|
||||
@testable import TunnelKitCore
|
||||
@testable import _TunnelKitCoreObjC
|
||||
import TunnelKitCoreTests
|
||||
|
||||
class LinkTests: XCTestCase {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// PacketTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 9/9/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// PushTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 8/24/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// StaticKeyTests.swift
|
||||
// TunnelKitTests
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 9/11/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// TestUtils+OpenVPN.swift
|
||||
// TunnelKitTests
|
||||
// TestUtils.swift
|
||||
// TunnelKitOpenVPNTests
|
||||
//
|
||||
// Created by Davide De Rosa on 7/7/18.
|
||||
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
|
||||
|
@ -39,6 +39,23 @@ import Foundation
|
|||
import _TunnelKitCoreObjC
|
||||
import _TunnelKitOpenVPNObjC
|
||||
|
||||
public class TestUtils {
|
||||
public static func uniqArray(_ v: [Int]) -> [Int] {
|
||||
return v.reduce([]){ $0.contains($1) ? $0 : $0 + [$1] }
|
||||
}
|
||||
|
||||
public static func generateDataSuite(_ size: Int, _ count: Int) -> [Data] {
|
||||
var suite = [Data]()
|
||||
for _ in 0..<count {
|
||||
suite.append(try! SecureRandom.data(length: size))
|
||||
}
|
||||
return suite
|
||||
}
|
||||
|
||||
private init() {
|
||||
}
|
||||
}
|
||||
|
||||
extension Encrypter {
|
||||
func encryptData(_ data: Data, flags: UnsafePointer<CryptoFlags>?) throws -> Data {
|
||||
let srcLength = data.count
|
Loading…
Reference in New Issue