Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7bde845

Browse files
committed
Run all tests when validating pod
1 parent 591a225 commit 7bde845

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

SQLite.swift.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Pod::Spec.new do |s|
3232

3333
ss.test_spec 'tests' do |test_spec|
3434
test_spec.resources = 'Tests/SQLiteTests/Resources/*'
35-
test_spec.source_files = 'Tests/SQLiteTests/*.swift'
35+
test_spec.source_files = 'Tests/SQLiteTests/**/*.swift'
3636
end
3737
end
3838

@@ -49,7 +49,7 @@ Pod::Spec.new do |s|
4949

5050
ss.test_spec 'tests' do |test_spec|
5151
test_spec.resources = 'Tests/SQLiteTests/Resources/*'
52-
test_spec.source_files = 'Tests/SQLiteTests/*.swift'
52+
test_spec.source_files = 'Tests/SQLiteTests/**/*.swift'
5353
end
5454
end
5555

@@ -72,7 +72,7 @@ Pod::Spec.new do |s|
7272

7373
ss.test_spec 'tests' do |test_spec|
7474
test_spec.resources = 'Tests/SQLiteTests/Resources/*'
75-
test_spec.source_files = 'Tests/SQLiteTests/*.swift'
75+
test_spec.source_files = 'Tests/SQLiteTests/**/*.swift'
7676
end
7777
end
7878
end

Tests/SQLiteTests/Core/ConnectionTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,4 +444,13 @@ class ConnectionTests: SQLiteTestCase {
444444
}
445445
semaphores.forEach { $0.wait() }
446446
}
447+
448+
#if SQLITE_SWIFT_STANDALONE
449+
func test_standalone_version_is_recent() throws {
450+
// when building standalone (= pod), we should have a more recent version
451+
let conn = try Connection(.inMemory)
452+
let version = conn.sqliteVersion
453+
XCTAssertGreaterThanOrEqual(version, .init(major: 3, minor: 51))
454+
}
455+
#endif
447456
}

Tests/SQLiteTests/Extensions/CipherTests.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,10 @@ class CipherTests: XCTestCase {
108108
}
109109

110110
private func keyData(length: Int = 64) -> NSData {
111-
let keyData = NSMutableData(length: length)!
112-
let result = SecRandomCopyBytes(kSecRandomDefault, length,
113-
keyData.mutableBytes.assumingMemoryBound(to: UInt8.self))
114-
XCTAssertEqual(0, result)
115-
return NSData(data: keyData)
111+
var bytes = [Int8](repeating: 0, count: length)
112+
let result = SecRandomCopyBytes(kSecRandomDefault, length, &bytes)
113+
XCTAssertEqual(errSecSuccess, result)
114+
return NSData(bytes: bytes, length: length)
116115
}
117116
}
118117
#endif

0 commit comments

Comments
 (0)