From ce2c3358efa20c2e55ce236a932d9c72f87b1fec Mon Sep 17 00:00:00 2001 From: Tomas Maly Date: Tue, 13 Jun 2023 10:45:32 -0400 Subject: [PATCH 1/2] Update run_tests.md Adding example for running unit tests on a pure swift package (SPM) --- docs/generated/actions/run_tests.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/generated/actions/run_tests.md b/docs/generated/actions/run_tests.md index 89a391f34..3158e55af 100644 --- a/docs/generated/actions/run_tests.md +++ b/docs/generated/actions/run_tests.md @@ -174,7 +174,7 @@ Returns | Outputs hash of results with the following keys: :number_of_tests, :nu -## 6 Examples +## 7 Examples ```ruby run_tests @@ -192,6 +192,18 @@ run_tests( ) ``` +```ruby +# run tests on a pure swift package (SPM), no xcodeproj or xcworkspace required +run_tests( + package_path: ".", + scheme: "MySwiftCode-Package", # Must have -Package + clean: true, + device: "iPhone 11 Pro", # Required for destination + result_bundle: true, # Last two lines may be required for proper xcresults output + output_directory: Dir.pwd + "/test_output" +) +``` + ```ruby # Build For Testing run_tests( From 2c04cdd4381fa06f570364568728ece719ddadb8 Mon Sep 17 00:00:00 2001 From: Tomas Maly Date: Tue, 13 Jun 2023 15:47:29 -0400 Subject: [PATCH 2/2] Update run_tests.md Adding notes for package_path --- docs/generated/actions/run_tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generated/actions/run_tests.md b/docs/generated/actions/run_tests.md index 3158e55af..57fbc8270 100644 --- a/docs/generated/actions/run_tests.md +++ b/docs/generated/actions/run_tests.md @@ -237,7 +237,7 @@ Key | Description | Default ----|-------------|-------- `workspace` | Path to the workspace file | `project` | Path to the project file | - `package_path` | Path to the Swift Package | + `package_path` | Path to the Swift Package (ie "."), required if it's a pure Swift Package with no project or workspace file | `scheme` | The project's scheme. Make sure it's marked as `Shared` | `device` | The name of the simulator type you want to run tests on (e.g. 'iPhone 6' or 'iPhone SE (2nd generation) (14.5)') | `devices` | Array of devices to run the tests on (e.g. ['iPhone 6', 'iPad Air', 'iPhone SE (2nd generation) (14.5)']) |