Skip to content

Commit 81b647f

Browse files
committed
Add optional performance testing to Package.swift
1 parent c4b0279 commit 81b647f

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

Package.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,23 @@ let package = Package(
103103
],
104104
swiftLanguageModes: [.v6]
105105
)
106+
107+
// The GRDB_PERFORMANCE_TESTS environment variable enables
108+
// the performance tests to be included in the package, which can be run with:
109+
// GRDB_PERFORMANCE_TESTS=1 swift test --filter GRDBPerformanceTests
110+
if ProcessInfo.processInfo.environment["GRDB_PERFORMANCE_TESTS"] == "1" {
111+
package.targets.append(
112+
Target.testTarget(
113+
name: "GRDBPerformanceTests",
114+
dependencies: ["GRDB"],
115+
path: "Tests/Performance/GRDBPerformance",
116+
cSettings: cSettings,
117+
swiftSettings: swiftSettings + [
118+
// Tests still use the Swift 5 language mode.
119+
.swiftLanguageMode(.v5),
120+
.enableUpcomingFeature("InferSendableFromCaptures"),
121+
.enableUpcomingFeature("GlobalActorIsolatedTypesUsability"),
122+
])
123+
)
124+
}
125+

Tests/Performance/GRDBPerformance/FetchPositionalValuesTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import XCTest
22
import GRDB
3+
#if GRDBCIPHER
4+
import SQLCipher
5+
#else
36
import SQLite3
7+
#endif
48
#if GRDB_COMPARE
59
import SQLite
610
#endif

Tests/Performance/GRDBPerformance/FetchRecordStructTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import XCTest
22
import GRDB
3+
#if GRDBCIPHER
4+
import SQLCipher
5+
#else
36
import SQLite3
7+
#endif
48
#if GRDB_COMPARE
59
import SQLite
610
#endif

Tests/Performance/GRDBPerformance/InsertPositionalValuesTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import XCTest
22
import GRDB
3+
#if GRDBCIPHER
4+
import SQLCipher
5+
#else
36
import SQLite3
7+
#endif
48
#if GRDB_COMPARE
59
import SQLite
610
#endif

0 commit comments

Comments
 (0)