Skip to content

Commit

Permalink
fixing build and test
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Oct 22, 2024
1 parent c848846 commit 0f824e9
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 15 deletions.
39 changes: 39 additions & 0 deletions .devcontainer/swift-5.8/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Swift",
"image": "swift:5.8",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root"
}
39 changes: 39 additions & 0 deletions .devcontainer/swift-6.0/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Swift",
"image": "swift:6.0",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
2 changes: 1 addition & 1 deletion .periphery.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
retain_public: true
targets:
- FelinePineLogging
- FelinePine
9 changes: 1 addition & 8 deletions Sources/FelinePine/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
#if canImport(os)

#if swift(<6.0)
import os
#else
public import os
#endif

/// os.Logger
public import os
public typealias Logger = os.Logger

Check notice on line 60 in Sources/FelinePine/Logger.swift

View check run for this annotation

codefactor.io / CodeFactor

Sources/FelinePine/Logger.swift#L60

public declarations should be documented. (missing_docs)
#endif
10 changes: 7 additions & 3 deletions Tests/FelinePineTests/FelinePineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@
import XCTest

internal final class FelinePineTests: XCTestCase {
internal func testLogger() {
_ = MockType.logger
XCTAssert(true)
internal func testLogger() throws {
#if canImport(os)
_ = MockType.logger
XCTAssert(true)
#else
throw XCTSkip("OSLog not available")
#endif
}
}
8 changes: 6 additions & 2 deletions Tests/FelinePineTests/LoggingSystemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ internal final class LoggingSystemTests: XCTestCase {
}
}

internal func testLogger() {
internal func testLogger() throws {
for category in MockSystem.Category.allCases {
_ = MockSystem.logger(forCategory: category)
#if canImport(os)
_ = MockSystem.logger(forCategory: category)
#else
throw XCTSkip("OSLog not available")
#endif
}
}
}
2 changes: 1 addition & 1 deletion Tests/FelinePineTests/Mocks/MockType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@testable import FelinePine
import XCTest

internal struct MockType: Feline, Pine {
internal struct MockType: Feline {
internal typealias LoggingSystemType = MockSystem

internal static let loggingCategory: MockSystem.Category = .alpha
Expand Down

0 comments on commit 0f824e9

Please sign in to comment.