Add optional performance testing to Package.swift

This commit is contained in:
Marc Prud'hommeaux authored and Gwendal Roué committed 2025-02-01 13:04:53 +01:00
1 parent 25eee6f981
commit 905cb3501a
4 files changed
+32

No files matched your search

+20
View File
@@ -103,3 +103,23 @@ let package = Package(
],
swiftLanguageModes: [.v6]
)
// The GRDB_PERFORMANCE_TESTS environment variable enables
// the performance tests to be included in the package, which can be run with:
// GRDB_PERFORMANCE_TESTS=1 swift test --filter GRDBPerformanceTests
if ProcessInfo.processInfo.environment["GRDB_PERFORMANCE_TESTS"] == "1" {
package.targets.append(
Target.testTarget(
name: "GRDBPerformanceTests",
dependencies: ["GRDB"],
path: "Tests/Performance/GRDBPerformance",
cSettings: cSettings,
swiftSettings: swiftSettings + [
// Tests still use the Swift 5 language mode.
.swiftLanguageMode(.v5),
.enableUpcomingFeature("InferSendableFromCaptures"),
.enableUpcomingFeature("GlobalActorIsolatedTypesUsability"),
])
)
}
@@ -1,6 +1,10 @@
import XCTest
import GRDB
#if GRDBCIPHER
import SQLCipher
#else
import SQLite3
#endif
#if GRDB_COMPARE
import SQLite
#endif
@@ -1,6 +1,10 @@
import XCTest
import GRDB
#if GRDBCIPHER
import SQLCipher
#else
import SQLite3
#endif
#if GRDB_COMPARE
import SQLite
#endif
@@ -1,6 +1,10 @@
import XCTest
import GRDB
#if GRDBCIPHER
import SQLCipher
#else
import SQLite3
#endif
#if GRDB_COMPARE
import SQLite
#endif