diff --git a/.env.beta b/.env.beta index c73b2e60..23f370fb 100644 --- a/.env.beta +++ b/.env.beta @@ -1,7 +1,6 @@ MATCH_TYPE="appstore" GYM_EXPORT_METHOD="app-store" GYM_SKIP_PACKAGE_PKG="false" -SCAN_PACKAGE_PATH="PassepartoutLibrary" DEMO_ACCOUNT_REQUIRED="true" PILOT_DISTRIBUTE_EXTERNAL="true" PILOT_BETA_APP_DESCRIPTION="Passepartout is a user-friendly VPN client." diff --git a/.env.ios b/.env.ios index fc5d7ff4..906e8700 100644 --- a/.env.ios +++ b/.env.ios @@ -1,7 +1,6 @@ INFO_PLIST_ROOT="Passepartout/App" MATCH_PLATFORM="ios" GYM_SCHEME="Passepartout" -SCAN_DEVICE="iPhone 12" DELIVER_PLATFORM="ios" DELIVER_METADATA_PATH="Passepartout/App/fastlane/ios/metadata" DELIVER_SCREENSHOTS_PATH="Passepartout/App/fastlane/ios/screenshots" diff --git a/.env.mac b/.env.mac index 5abb28a6..79c707bc 100644 --- a/.env.mac +++ b/.env.mac @@ -3,9 +3,6 @@ MATCH_PLATFORM="catalyst" MATCH_ADDITIONAL_CERT_TYPES="mac_installer_distribution" GYM_SCHEME="Passepartout" GYM_CATALYST_PLATFORM="macos" - -# not sure about these -SCAN_DESTINATION="platform=iOS" DELIVER_PLATFORM="osx" DELIVER_METADATA_PATH="Passepartout/App/fastlane/mac/metadata" DELIVER_SCREENSHOTS_PATH="Passepartout/App/fastlane/mac/screenshots" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32e2e41c..4fd850a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,22 +1,18 @@ name: Unit Tests on: - push: - branches-ignore: - - 'master' # temporary - - 'test/*' + pull_request: + types: [ opened, synchronize ] paths-ignore: - '.beta-*' - - 'Passepartout.xcodeproj/project.pbxproj' - - '**/Info.plist' - - '**/CHANGELOG.md' - - '**/release_notes.txt' + - '**/*.md' + - 'Passepartout/App/fastlane/**' jobs: run_tests: name: Run tests runs-on: macos-12 - timeout-minutes: 20 + timeout-minutes: 15 steps: - uses: actions/checkout@v2 with: @@ -24,7 +20,12 @@ jobs: - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - uses: actions/setup-go@v3 + with: + go-version: "^1.17" - name: Run tests run: | - cd PassepartoutLibrary - swift test + bundle exec fastlane --env beta,ios scan diff --git a/Passepartout.xcodeproj/project.pbxproj b/Passepartout.xcodeproj/project.pbxproj index edd60ce3..bbddb747 100644 --- a/Passepartout.xcodeproj/project.pbxproj +++ b/Passepartout.xcodeproj/project.pbxproj @@ -133,6 +133,8 @@ 0EA1D84728805EAE00F3CA48 /* Flags.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0EA1D84628805EAE00F3CA48 /* Flags.xcassets */; }; 0EA591162733DDDA0096F796 /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 0EA591142733DDDA0096F796 /* Intents.intentdefinition */; }; 0EA9030B287045F70087BC73 /* SystemMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EA9030A287045F70087BC73 /* SystemMenu.swift */; }; + 0EB13BBE290E835A003CB654 /* PassepartoutLibrary in Frameworks */ = {isa = PBXBuildFile; productRef = 0EB13BBD290E835A003CB654 /* PassepartoutLibrary */; }; + 0EB13BC0290E8C8D003CB654 /* PassepartoutTestsApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB13BBF290E8C8D003CB654 /* PassepartoutTestsApp.swift */; }; 0EB17EA727D226B400D473B5 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB17EA127D2263700D473B5 /* Constants.swift */; }; 0EB17EA927D226C900D473B5 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB17EA127D2263700D473B5 /* Constants.swift */; }; 0EB17EAA27D226C900D473B5 /* Constants+App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB17EA527D2263700D473B5 /* Constants+App.swift */; }; @@ -201,6 +203,13 @@ remoteGlobalIDString = 0E41BD96286711C3006346B4; remoteInfo = PassepartoutLauncher; }; + 0EB13BBB290E82F1003CB654 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0E57F63020C83FC5008323CF /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0ECF71F327B6D9CD00CDB528; + remoteInfo = WireGuardGo; + }; 0EB2B1492733FB6F007705AB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0E57F63020C83FC5008323CF /* Project object */; @@ -425,6 +434,8 @@ 0EA5912C2733DDFC0096F796 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Intents.strings; sourceTree = ""; }; 0EA5912E2733DDFD0096F796 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Intents.strings; sourceTree = ""; }; 0EA9030A287045F70087BC73 /* SystemMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemMenu.swift; sourceTree = ""; }; + 0EB13BAC290E825E003CB654 /* PassepartoutTests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PassepartoutTests.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0EB13BBF290E8C8D003CB654 /* PassepartoutTestsApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PassepartoutTestsApp.swift; sourceTree = ""; }; 0EB17EA127D2263700D473B5 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; 0EB17EA327D2263700D473B5 /* LocalProduct.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalProduct.swift; sourceTree = ""; }; 0EB17EA527D2263700D473B5 /* Constants+App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Constants+App.swift"; sourceTree = ""; }; @@ -510,6 +521,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 0EB13BA9290E825E003CB654 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0EB13BBE290E835A003CB654 /* PassepartoutLibrary in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 0ECB78D7285F52F700B0E460 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -755,6 +774,7 @@ 0EE315DB2733104700F5D461 /* Packages */, 0E23B4A12298559800304C30 /* Config.xcconfig */, 0E9AA982259F7674003FAFF1 /* Passepartout */, + 0EB13BAD290E825E003CB654 /* PassepartoutTests */, 0E57F63920C83FC5008323CF /* Products */, 374B9F085E1148C37CF9117A /* Frameworks */, ); @@ -768,6 +788,7 @@ 0ED2B34A27D3C77800FD8EA9 /* PassepartoutWireGuardTunnel.appex */, 0E41BD97286711C3006346B4 /* PassepartoutLauncher.app */, 0ECB78DA285F52F700B0E460 /* PassepartoutMac.bundle */, + 0EB13BAC290E825E003CB654 /* PassepartoutTests.app */, ); name = Products; sourceTree = ""; @@ -863,6 +884,14 @@ path = Intents; sourceTree = ""; }; + 0EB13BAD290E825E003CB654 /* PassepartoutTests */ = { + isa = PBXGroup; + children = ( + 0EB13BBF290E8C8D003CB654 /* PassepartoutTestsApp.swift */, + ); + path = PassepartoutTests; + sourceTree = ""; + }; 0ECB78D1285F4F4000B0E460 /* AppShared */ = { isa = PBXGroup; children = ( @@ -1031,6 +1060,27 @@ productReference = 0E57F63820C83FC5008323CF /* Passepartout.app */; productType = "com.apple.product-type.application"; }; + 0EB13BAB290E825E003CB654 /* PassepartoutTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0EB13BBA290E8260003CB654 /* Build configuration list for PBXNativeTarget "PassepartoutTests" */; + buildPhases = ( + 0EB13BA8290E825E003CB654 /* Sources */, + 0EB13BA9290E825E003CB654 /* Frameworks */, + 0EB13BAA290E825E003CB654 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 0EB13BBC290E82F1003CB654 /* PBXTargetDependency */, + ); + name = PassepartoutTests; + packageProductDependencies = ( + 0EB13BBD290E835A003CB654 /* PassepartoutLibrary */, + ); + productName = PassepartoutTests; + productReference = 0EB13BAC290E825E003CB654 /* PassepartoutTests.app */; + productType = "com.apple.product-type.application"; + }; 0ECB78D9285F52F700B0E460 /* PassepartoutMac */ = { isa = PBXNativeTarget; buildConfigurationList = 0ECB78DD285F52F700B0E460 /* Build configuration list for PBXNativeTarget "PassepartoutMac" */; @@ -1097,7 +1147,7 @@ 0E57F63020C83FC5008323CF /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1340; + LastSwiftUpdateCheck = 1400; LastUpgradeCheck = 1400; ORGANIZATIONNAME = "Davide De Rosa"; TargetAttributes = { @@ -1122,6 +1172,10 @@ }; }; }; + 0EB13BAB290E825E003CB654 = { + CreatedOnToolsVersion = 14.0.1; + LastSwiftMigration = 1400; + }; 0ECB78D9285F52F700B0E460 = { CreatedOnToolsVersion = 13.4; LastSwiftMigration = 1340; @@ -1173,6 +1227,7 @@ 0E57F63720C83FC5008323CF /* Passepartout */, 0ECB78D9285F52F700B0E460 /* PassepartoutMac */, 0E41BD96286711C3006346B4 /* PassepartoutLauncher */, + 0EB13BAB290E825E003CB654 /* PassepartoutTests */, 0EDE8DBE20C86910004C739C /* OpenVPNTunnel */, 0ECF71F327B6D9CD00CDB528 /* WireGuardGo */, 0ED2B33E27D3C77800FD8EA9 /* WireGuardTunnel */, @@ -1203,6 +1258,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 0EB13BAA290E825E003CB654 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 0ECB78D8285F52F700B0E460 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1431,6 +1493,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 0EB13BA8290E825E003CB654 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0EB13BC0290E8C8D003CB654 /* PassepartoutTestsApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 0ED2B34027D3C77800FD8EA9 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1459,6 +1529,11 @@ target = 0E41BD96286711C3006346B4 /* PassepartoutLauncher */; targetProxy = 0E41BDAA286713F6006346B4 /* PBXContainerItemProxy */; }; + 0EB13BBC290E82F1003CB654 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 0ECF71F327B6D9CD00CDB528 /* WireGuardGo */; + targetProxy = 0EB13BBB290E82F1003CB654 /* PBXContainerItemProxy */; + }; 0EB2B14A2733FB6F007705AB /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 0EDE8DBE20C86910004C739C /* OpenVPNTunnel */; @@ -1780,6 +1855,73 @@ }; name = Release; }; + 0EB13BB8290E8260003CB654 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Manual; + COPY_PHASE_STRIP = NO; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.ios.PassepartoutTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 0EB13BB9290E8260003CB654 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Manual; + COPY_PHASE_STRIP = NO; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.ios.PassepartoutTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; 0ECB78DB285F52F700B0E460 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1996,6 +2138,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 0EB13BBA290E8260003CB654 /* Build configuration list for PBXNativeTarget "PassepartoutTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0EB13BB8290E8260003CB654 /* Debug */, + 0EB13BB9290E8260003CB654 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 0ECB78DD285F52F700B0E460 /* Build configuration list for PBXNativeTarget "PassepartoutMac" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -2051,6 +2202,10 @@ package = 0E53249B27D28FC7002565C3 /* XCRemoteSwiftPackageReference "Kvitto" */; productName = Kvitto; }; + 0EB13BBD290E835A003CB654 /* PassepartoutLibrary */ = { + isa = XCSwiftPackageProductDependency; + productName = PassepartoutLibrary; + }; 0ECB78EB2863A21600B0E460 /* PassepartoutLibrary */ = { isa = XCSwiftPackageProductDependency; productName = PassepartoutLibrary; diff --git a/Passepartout.xcodeproj/xcshareddata/xcschemes/PassepartoutTests.xcscheme b/Passepartout.xcodeproj/xcshareddata/xcschemes/PassepartoutTests.xcscheme new file mode 100644 index 00000000..5890cdc7 --- /dev/null +++ b/Passepartout.xcodeproj/xcshareddata/xcschemes/PassepartoutTests.xcscheme @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PassepartoutLibrary/.swiftpm/xcode/xcshareddata/xcschemes/PassepartoutLibrary.xcscheme b/PassepartoutLibrary/.swiftpm/xcode/xcshareddata/xcschemes/PassepartoutLibrary.xcscheme new file mode 100644 index 00000000..f270c650 --- /dev/null +++ b/PassepartoutLibrary/.swiftpm/xcode/xcshareddata/xcschemes/PassepartoutLibrary.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PassepartoutLibrary/Package.swift b/PassepartoutLibrary/Package.swift index 06d049b2..72bd268a 100644 --- a/PassepartoutLibrary/Package.swift +++ b/PassepartoutLibrary/Package.swift @@ -89,15 +89,21 @@ let package = Package( dependencies: [ .product(name: "TunnelKitWireGuardAppExtension", package: "TunnelKit") ]), -// .testTarget( -// name: "PassepartoutLibraryTests", -// dependencies: ["PassepartoutLibrary"]), -// .testTarget( -// name: "PassepartoutProfilesTests", -// dependencies: ["PassepartoutProfiles"]), + .testTarget( + name: "PassepartoutLibraryTests", + dependencies: ["PassepartoutLibrary"]), + .testTarget( + name: "PassepartoutVPNTests", + dependencies: ["PassepartoutVPN"]), + .testTarget( + name: "PassepartoutProfilesTests", + dependencies: ["PassepartoutProfiles"]), .testTarget( name: "PassepartoutProvidersTests", dependencies: ["PassepartoutProviders"]), + .testTarget( + name: "PassepartoutCoreTests", + dependencies: ["PassepartoutCore"]), .testTarget( name: "PassepartoutServicesTests", dependencies: ["PassepartoutServices"]), diff --git a/PassepartoutLibrary/Tests/PassepartoutCoreTests/CoreTests.swift b/PassepartoutLibrary/Tests/PassepartoutCoreTests/CoreTests.swift index bfabcd25..513c8e3e 100644 --- a/PassepartoutLibrary/Tests/PassepartoutCoreTests/CoreTests.swift +++ b/PassepartoutLibrary/Tests/PassepartoutCoreTests/CoreTests.swift @@ -3,7 +3,7 @@ // Passepartout // // Created by Davide De Rosa on 3/30/19. -// Copyright (c) 2020 Davide De Rosa. All rights reserved. +// Copyright (c) 2022 Davide De Rosa. All rights reserved. // // https://github.com/passepartoutvpn // @@ -24,7 +24,7 @@ // import XCTest -import PassepartoutLibrary +@testable import PassepartoutCore class CoreTests: XCTestCase { override func setUp() { @@ -33,4 +33,4 @@ class CoreTests: XCTestCase { override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } - } +} diff --git a/PassepartoutLibrary/Tests/PassepartoutLibraryTests/LibraryTests.swift b/PassepartoutLibrary/Tests/PassepartoutLibraryTests/LibraryTests.swift new file mode 100644 index 00000000..0999091a --- /dev/null +++ b/PassepartoutLibrary/Tests/PassepartoutLibraryTests/LibraryTests.swift @@ -0,0 +1,36 @@ +// +// LibraryTests.swift +// Passepartout +// +// Created by Davide De Rosa on 10/29/22. +// Copyright (c) 2022 Davide De Rosa. All rights reserved. +// +// https://github.com/passepartoutvpn +// +// This file is part of Passepartout. +// +// Passepartout is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Passepartout is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Passepartout. If not, see . +// + +import XCTest +@testable import PassepartoutLibrary + +class LibraryTests: XCTestCase { + override func setUp() { + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + } diff --git a/PassepartoutLibrary/Tests/PassepartoutProvidersTests/ProvidersTests.swift b/PassepartoutLibrary/Tests/PassepartoutProvidersTests/ProvidersTests.swift index 887ed3b1..60315348 100644 --- a/PassepartoutLibrary/Tests/PassepartoutProvidersTests/ProvidersTests.swift +++ b/PassepartoutLibrary/Tests/PassepartoutProvidersTests/ProvidersTests.swift @@ -35,7 +35,7 @@ import SwiftyBeaver class ProvidersTests: XCTestCase { private static let persistence: Persistence = { let model = NSManagedObjectModel.mergedModel(from: [.module])! - return Persistence(withLocalName: "Providers", model: model, author: nil) + return Persistence(withLocalName: "ProvidersTests", model: model, author: nil) }() private var manager: ProviderManager! diff --git a/PassepartoutLibrary/Tests/PassepartoutServicesTests/ServicesTests.swift b/PassepartoutLibrary/Tests/PassepartoutServicesTests/ServicesTests.swift index 091c1077..8d819e7d 100644 --- a/PassepartoutLibrary/Tests/PassepartoutServicesTests/ServicesTests.swift +++ b/PassepartoutLibrary/Tests/PassepartoutServicesTests/ServicesTests.swift @@ -3,7 +3,7 @@ // Passepartout // // Created by Davide De Rosa on 6/11/18. -// Copyright (c) 2020 Davide De Rosa. All rights reserved. +// Copyright (c) 2022 Davide De Rosa. All rights reserved. // // https://github.com/passepartoutvpn // diff --git a/PassepartoutLibrary/Tests/PassepartoutUtilsTests/UtilsTests.swift b/PassepartoutLibrary/Tests/PassepartoutUtilsTests/UtilsTests.swift index 480a9a1f..c5f0b42f 100644 --- a/PassepartoutLibrary/Tests/PassepartoutUtilsTests/UtilsTests.swift +++ b/PassepartoutLibrary/Tests/PassepartoutUtilsTests/UtilsTests.swift @@ -3,7 +3,7 @@ // Passepartout // // Created by Davide De Rosa on 3/30/19. -// Copyright (c) 2020 Davide De Rosa. All rights reserved. +// Copyright (c) 2022 Davide De Rosa. All rights reserved. // // https://github.com/passepartoutvpn // @@ -24,7 +24,7 @@ // import XCTest -import PassepartoutUtils +@testable import PassepartoutUtils import SwiftyBeaver class UtilsTests: XCTestCase { @@ -44,7 +44,10 @@ class UtilsTests: XCTestCase { let languagesEN = privateSortedLanguages(languages, with: english) let languagesIT = privateSortedLanguages(languages, with: italian) + // English, German, Italian, Portuguese, Russian XCTAssertEqual(languagesEN, ["en", "de", "it", "pt-BR", "ru"]) + + // Inglese, Italiano, Portoghese, Russo, Tedesco XCTAssertEqual(languagesIT, ["en", "it", "pt-BR", "ru", "de"]) } diff --git a/PassepartoutLibrary/Tests/PassepartoutVPNTests/VPNTests.swift b/PassepartoutLibrary/Tests/PassepartoutVPNTests/VPNTests.swift new file mode 100644 index 00000000..f24d1f07 --- /dev/null +++ b/PassepartoutLibrary/Tests/PassepartoutVPNTests/VPNTests.swift @@ -0,0 +1,36 @@ +// +// VPNTests.swift +// Passepartout +// +// Created by Davide De Rosa on 10/29/22. +// Copyright (c) 2022 Davide De Rosa. All rights reserved. +// +// https://github.com/passepartoutvpn +// +// This file is part of Passepartout. +// +// Passepartout is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Passepartout is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Passepartout. If not, see . +// + +import XCTest +@testable import PassepartoutVPN + +class VPNTests: XCTestCase { + override func setUp() { + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + } diff --git a/PassepartoutTests/PassepartoutTestsApp.swift b/PassepartoutTests/PassepartoutTestsApp.swift new file mode 100644 index 00000000..b5f4ba4a --- /dev/null +++ b/PassepartoutTests/PassepartoutTestsApp.swift @@ -0,0 +1,35 @@ +// +// PassepartoutTestsApp.swift +// Passepartout +// +// Created by Davide De Rosa on 10/30/22. +// Copyright (c) 2022 Davide De Rosa. All rights reserved. +// +// https://github.com/passepartoutvpn +// +// This file is part of Passepartout. +// +// Passepartout is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Passepartout is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Passepartout. If not, see . +// + +import SwiftUI + +@main +struct PassepartoutTestsApp: App { + var body: some Scene { + WindowGroup { + EmptyView() + } + } +} diff --git a/fastlane/Deliverfile b/fastlane/Deliverfile index 92200b87..8a6224cf 100644 --- a/fastlane/Deliverfile +++ b/fastlane/Deliverfile @@ -2,6 +2,7 @@ # For more information, check out the docs # https://docs.fastlane.tools/actions/deliver/ +automatic_release false skip_binary_upload true skip_metadata false skip_screenshots false diff --git a/fastlane/Scanfile b/fastlane/Scanfile new file mode 100644 index 00000000..cb22a493 --- /dev/null +++ b/fastlane/Scanfile @@ -0,0 +1,2 @@ +scheme "PassepartoutTests" +device "iPhone 14"