Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 5.10
import PackageDescription

let package = Package(
Expand Down
13 changes: 12 additions & 1 deletion Plugins/SkipPlugin/SkipPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ import PackagePlugin
let sourceBase = URL(fileURLWithPath: isTest ? "src/test" : "src/main", isDirectory: true, relativeTo: outputBase)

var buildArguments = [
"transpile",
"skipstone",
"--project", swiftSourceTarget.directory.string,
"--skip-folder", skipFolder.string,
"--sourcehash", sourcehashOutputPath.string,
Expand Down Expand Up @@ -344,6 +344,17 @@ import PackagePlugin
appendArguments(["--skip-bridge-output", skipBridgeOutputDir.string])
}

// auto-generate XCSkipTests.swift test harness for test targets that don't already have one
if isTest {
let hasTestHarness = target.sourceFiles(withSuffix: "swift").contains(where: { $0.path.lastComponent == "XCSkipTests.swift" })
if !hasTestHarness {
let testHarnessOutputDir = outputFolder.appending(subpath: "SkipTestHarness")
let testHarnessPath = testHarnessOutputDir.appending(subpath: "XCSkipTests.swift")
outputFiles.append(testHarnessPath)
appendArguments(["--test-harness-output", testHarnessPath.string])
}
}

appendArguments(buildModuleArgs)

//Diagnostics.remark("invoke skip \(buildArguments.joined(separator: " "))")
Expand Down
73 changes: 34 additions & 39 deletions Tests/SkipDriveTests/SkipDriveTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ class SkipCommandTests : XCTestCase {
├─ HelloSkipTests.swift
├─ Resources
│ └─ TestData.json
├─ Skip
│ └─ skip.yml
└─ XCSkipTests.swift
└─ Skip
└─ skip.yml

""")
}
Expand Down Expand Up @@ -326,9 +325,8 @@ class SkipCommandTests : XCTestCase {
├─ DemoTests.swift
├─ Resources
│ └─ TestData.json
├─ Skip
│ └─ skip.yml
└─ XCSkipTests.swift
└─ Skip
└─ skip.yml

""")

Expand Down Expand Up @@ -448,9 +446,9 @@ class SkipCommandTests : XCTestCase {
│ ├─ DemoTests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
└─ empty.png

""")
Expand Down Expand Up @@ -576,9 +574,9 @@ class SkipCommandTests : XCTestCase {
│ ├─ DemoTests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
└─ empty.png

""")
Expand Down Expand Up @@ -721,9 +719,9 @@ class SkipCommandTests : XCTestCase {
│ ├─ DemoTests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
└─ empty.png

""")
Expand Down Expand Up @@ -888,16 +886,15 @@ class SkipCommandTests : XCTestCase {
│ ├─ HelloSkipModelTests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
└─ HelloSkipTests
├─ HelloSkipTests.swift
├─ Resources
│ └─ TestData.json
├─ Skip
│ └─ skip.yml
└─ XCSkipTests.swift
└─ Skip
└─ skip.yml

""")

Expand Down Expand Up @@ -966,37 +963,36 @@ class SkipCommandTests : XCTestCase {
│ ├─ CoolATests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
├─ CoolBTests
│ ├─ CoolBTests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
├─ CoolCTests
│ ├─ CoolCTests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
├─ CoolDTests
│ ├─ CoolDTests.swift
│ ├─ Resources
│ │ └─ TestData.json
─ Skip
└─ skip.yml
└─ XCSkipTests.swift
─ Skip
└─ skip.yml
└─ CoolETests
├─ CoolETests.swift
├─ Resources
│ └─ TestData.json
├─ Skip
│ └─ skip.yml
└─ XCSkipTests.swift
└─ Skip
└─ skip.yml

""")
}
Expand Down Expand Up @@ -1045,9 +1041,8 @@ class SkipCommandTests : XCTestCase {
├─ NeatATests.swift
├─ Resources
│ └─ TestData.json
├─ Skip
│ └─ skip.yml
└─ XCSkipTests.swift
└─ Skip
└─ skip.yml

""")
}
Expand Down
Loading