Fix test inter-dependencies

Cannot depend on another test target?
This commit is contained in:
Davide De Rosa 2021-11-02 22:52:47 +01:00
parent d977c3317c
commit e49e3cad08
19 changed files with 39 additions and 30 deletions

View File

@ -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"
]),
]

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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 {

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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!

View File

@ -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!

View File

@ -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.

View File

@ -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 {

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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