From 93eb91b8265d6cdc98c615db08122a97fe47ae28 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Sat, 30 Nov 2024 13:38:40 -0500 Subject: [PATCH] Test fixes for Windows --- .github/workflows/ci.yml | 2 +- Tests/SQLiteDBTests/Core/ConnectionTests.swift | 2 +- Tests/SQLiteDBTests/Extensions/CipherTests.swift | 2 +- Tests/SQLiteDBTests/Schema/SchemaDefinitionsTests.swift | 4 ++-- Tests/SQLiteDBTests/Typed/CustomAggregationTests.swift | 2 +- Tests/SQLiteDBTests/Typed/CustomFunctionsTests.swift | 2 +- Tests/SQLiteDBTests/Typed/QueryTests.swift | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5caad9c..182a407 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: schedule: - cron: '0 6,18 * * *' jobs: - test: + darwin+android: # emulator fails to launch on ARM macOS with: HVF error: HV_UNSUPPORTED #runs-on: macos-15 # so we need to run on Intel macOS diff --git a/Tests/SQLiteDBTests/Core/ConnectionTests.swift b/Tests/SQLiteDBTests/Core/ConnectionTests.swift index 324e7dc..f1e6bc5 100644 --- a/Tests/SQLiteDBTests/Core/ConnectionTests.swift +++ b/Tests/SQLiteDBTests/Core/ConnectionTests.swift @@ -374,7 +374,7 @@ class ConnectionTests: SQLiteTestCase { } // https://github.com/stephencelis/SQLite.swift/issues/1071 - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func test_createFunction_withArrayArguments() throws { db.createFunction("hello") { $0[0].map { "Hello, \($0)!" } } diff --git a/Tests/SQLiteDBTests/Extensions/CipherTests.swift b/Tests/SQLiteDBTests/Extensions/CipherTests.swift index 8462033..db02537 100644 --- a/Tests/SQLiteDBTests/Extensions/CipherTests.swift +++ b/Tests/SQLiteDBTests/Extensions/CipherTests.swift @@ -85,7 +85,7 @@ class CipherTests: XCTestCase { fixture("encrypted-3.x", withExtension: "sqlite") : fixture("encrypted-4.x", withExtension: "sqlite") - #if !os(Android) // file permission modification unsupported on Android + #if !os(Android) && !os(Linux) // file permission modification unsupported on Android try FileManager.default.setAttributes([FileAttributeKey.immutable: 1], ofItemAtPath: encryptedFile) XCTAssertFalse(FileManager.default.isWritableFile(atPath: encryptedFile)) #endif diff --git a/Tests/SQLiteDBTests/Schema/SchemaDefinitionsTests.swift b/Tests/SQLiteDBTests/Schema/SchemaDefinitionsTests.swift index 234954b..85d3026 100644 --- a/Tests/SQLiteDBTests/Schema/SchemaDefinitionsTests.swift +++ b/Tests/SQLiteDBTests/Schema/SchemaDefinitionsTests.swift @@ -32,7 +32,7 @@ class ColumnDefinitionTests: XCTestCase { defaultValue: .numericLiteral("123.123"), references: nil)) ] - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) override class var defaultTestSuite: XCTestSuite { let suite = XCTestSuite(forTestCaseClass: ColumnDefinitionTests.self) @@ -183,7 +183,7 @@ class IndexDefinitionTests: XCTestCase { "CREATE INDEX IF NOT EXISTS \"index_tests\" ON \"tests\" (\"test_column\")") ] - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) override class var defaultTestSuite: XCTestSuite { let suite = XCTestSuite(forTestCaseClass: IndexDefinitionTests.self) diff --git a/Tests/SQLiteDBTests/Typed/CustomAggregationTests.swift b/Tests/SQLiteDBTests/Typed/CustomAggregationTests.swift index 43a2a11..dee2ced 100644 --- a/Tests/SQLiteDBTests/Typed/CustomAggregationTests.swift +++ b/Tests/SQLiteDBTests/Typed/CustomAggregationTests.swift @@ -14,7 +14,7 @@ import SQLite3 #endif // https://github.com/stephencelis/SQLite.swift/issues/1071 -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) class CustomAggregationTests: SQLiteTestCase { override func setUpWithError() throws { diff --git a/Tests/SQLiteDBTests/Typed/CustomFunctionsTests.swift b/Tests/SQLiteDBTests/Typed/CustomFunctionsTests.swift index 6859768..3090bb6 100644 --- a/Tests/SQLiteDBTests/Typed/CustomFunctionsTests.swift +++ b/Tests/SQLiteDBTests/Typed/CustomFunctionsTests.swift @@ -2,7 +2,7 @@ import XCTest import SQLiteDB // https://github.com/stephencelis/SQLite.swift/issues/1071 -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) class CustomFunctionNoArgsTests: SQLiteTestCase { typealias FunctionNoOptional = () -> Expression diff --git a/Tests/SQLiteDBTests/Typed/QueryTests.swift b/Tests/SQLiteDBTests/Typed/QueryTests.swift index bb02e12..033454c 100644 --- a/Tests/SQLiteDBTests/Typed/QueryTests.swift +++ b/Tests/SQLiteDBTests/Typed/QueryTests.swift @@ -354,7 +354,7 @@ class QueryTests: XCTestCase { ) } - #if !os(Linux) && !os(Android) // depends on exact JSON serialization + #if !os(Linux) && !os(Android) && !os(Windows) // depends on exact JSON serialization func test_insert_encodable_with_nested_encodable() throws { let emails = Table("emails") let value1 = TestCodable(int: 1, string: "2", bool: true, float: 3, double: 4,