Skip to content

Commit

Permalink
chore: remove swift-macro-testing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
EnesKaraosman committed Sep 21, 2024
1 parent ee12052 commit fc60a28
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
22 changes: 2 additions & 20 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,13 @@
"version" : "5.1.0"
}
},
{
"identity" : "swift-macro-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-macro-testing",
"state" : {
"revision" : "20c1a8f3b624fb5d1503eadcaa84743050c350f4",
"version" : "0.5.2"
}
},
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : {
"revision" : "6d932a79e7173b275b96c600c86c603cf84f153c",
"version" : "1.17.4"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82",
"version" : "510.0.3"
"revision" : "cb53fa1bd3219b0b23ded7dfdd3b2baff266fd25",
"version" : "600.0.0"
}
}
],
Expand Down
2 changes: 0 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let package = Package(
dependencies: [
// Depend on the Swift 5.9 release of SwiftSyntax
.package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.0"),
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.5.2"),
.package(url: "https://github.com/vadymmarkov/Fakery", from: "5.1.0")
],
targets: [
Expand Down Expand Up @@ -54,7 +53,6 @@ let package = Package(
dependencies: [
"LoremSwiftifyMacros",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
.product(name: "MacroTesting", package: "swift-macro-testing"),
]
),
]
Expand Down
3 changes: 1 addition & 2 deletions Tests/LoremSwiftsumizeTests/LoremSwiftsumizeTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import MacroTesting
import XCTest

final class LoremSwiftifyTests: MacroTestCase {
final class LoremSwiftifyTests: XCTestCase {

}
30 changes: 20 additions & 10 deletions Tests/LoremSwiftsumizeTests/TestUtils/MacroTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,31 @@
import Foundation
import SwiftSyntaxMacros
import SwiftSyntaxMacrosTestSupport
import MacroTesting
import XCTest

#if canImport(LoremSwiftifyMacros)
import LoremSwiftifyMacros

let testMacros: [String: Macro.Type] = [
"LoremSwiftifyMacros": LoremSwiftifyMacro.self
]
#endif

class MacroTestCase: XCTestCase {
override func invokeTest() {
#if canImport(LoremSwiftifyMacros)
withMacroTesting(record: false, macros: ["LoremSwiftifyMacros": LoremSwiftifyMacro.self]) {
super.invokeTest()
}
#else
fatalError("Macro tests can only be run on the host platform!")
#endif
extension XCTestCase {
func assertMacro(
_ originalSource: String,
expandedSource expectedExpandedSource: String,
diagnostics: [DiagnosticSpec] = [],
applyFixIts: [String]? = nil,
fixedSource expectedFixedSource: String? = nil
) {
assertMacroExpansion(
originalSource,
expandedSource: expectedExpandedSource,
diagnostics: diagnostics,
macros: testMacros,
applyFixIts: applyFixIts,
fixedSource: expectedFixedSource
)
}
}

0 comments on commit fc60a28

Please sign in to comment.