Skip to content

Commit

Permalink
Make import XCTest only active in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasnickel committed May 24, 2022
1 parent 2d5c091 commit ad27702
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ let package = Package(
targets: [
.target(
name: "SI",
dependencies: [],
exclude: ["Tests"]),
dependencies: []),

.testTarget(
name: "SITests",
Expand Down
2 changes: 1 addition & 1 deletion Sources/SI/Precondition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
/// At runtime while performing an XCTest, it will be changed to a different function in order to evaluate its output.
/// Adapted from Nikolaj Schumacher (@nschum)

#if DEBUG
import XCTest

#if DEBUG
func precondition(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) {
preconditionClosure(condition(), message(), file, line)
}
Expand Down

0 comments on commit ad27702

Please sign in to comment.