From 1bf4240576f568c8e623511c2f3adfedc9b32784 Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Sun, 28 Jul 2024 14:08:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fastlane=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 6 +++ fastlane/Fastfile | 11 ++++++ fastlane/README.md | 30 +++++++++++++++ .../project.pbxproj | 2 + .../xcschemes/SwiftUISampleApp.xcscheme | 22 ++++++++++- sources/SwiftUISampleApp.xctestplan | 38 +++++++++++++++++++ 6 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 Gemfile create mode 100644 fastlane/Fastfile create mode 100644 fastlane/README.md create mode 100644 sources/SwiftUISampleApp.xctestplan diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..1e4d11c --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "fastlane" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..c0646da --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,11 @@ +opt_out_usage + +default_platform(:ios) + +desc "Run Core unit tests" +lane :tests do + scan( + devices: ["iPhone 15"], + project: "sources/SwiftUISampleApp.xcodeproj", + ) +end \ No newline at end of file diff --git a/fastlane/README.md b/fastlane/README.md new file mode 100644 index 0000000..acd25a9 --- /dev/null +++ b/fastlane/README.md @@ -0,0 +1,30 @@ +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +### tests + +```sh +[bundle exec] fastlane tests +``` + +Run Core unit tests + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/sources/SwiftUISampleApp.xcodeproj/project.pbxproj b/sources/SwiftUISampleApp.xcodeproj/project.pbxproj index 11e518b..b533bf1 100644 --- a/sources/SwiftUISampleApp.xcodeproj/project.pbxproj +++ b/sources/SwiftUISampleApp.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ F3A329D12C52917800C73225 /* SwiftUISampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUISampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; F3A329D42C52917800C73225 /* SwiftUISampleAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUISampleAppApp.swift; sourceTree = ""; }; F3A329D82C52917A00C73225 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F3EA80282C566B6E004612CF /* SwiftUISampleApp.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = SwiftUISampleApp.xctestplan; sourceTree = ""; }; F3F1AE9A2C543F270028B236 /* Core */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Core; sourceTree = ""; }; F3F1AE9B2C543F270028B236 /* App */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = App; sourceTree = ""; }; F3F1AE9C2C543F270028B236 /* Features */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Features; sourceTree = ""; }; @@ -45,6 +46,7 @@ F3A329C82C52917800C73225 = { isa = PBXGroup; children = ( + F3EA80282C566B6E004612CF /* SwiftUISampleApp.xctestplan */, F3F1AE9B2C543F270028B236 /* App */, F3F1AE9A2C543F270028B236 /* Core */, F3F1AE9C2C543F270028B236 /* Features */, diff --git a/sources/SwiftUISampleApp.xcodeproj/xcshareddata/xcschemes/SwiftUISampleApp.xcscheme b/sources/SwiftUISampleApp.xcodeproj/xcshareddata/xcschemes/SwiftUISampleApp.xcscheme index cbc1c12..af149c2 100644 --- a/sources/SwiftUISampleApp.xcodeproj/xcshareddata/xcschemes/SwiftUISampleApp.xcscheme +++ b/sources/SwiftUISampleApp.xcodeproj/xcshareddata/xcschemes/SwiftUISampleApp.xcscheme @@ -27,8 +27,26 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES" - shouldAutocreateTestPlan = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + + +