Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Run tests under Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaxter committed Dec 5, 2016
1 parent 50f0cff commit 8f0ffc4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Tests/EvergreenTests/LoggerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,19 @@ class LoggerTests: StenographyTestCase {
XCTAssert(logLevels.sorted(by: <) == logLevels, "Log levels initialized by sequencial raw values are not ordered by comparison operator.")
}

#if !os(Linux)
func testErrorTypeLogging() {
let error = NSError(domain: "error_domain", code: 0, userInfo: nil)
Evergreen.verbose("Something failed", error: error)
}

#endif

static var allTests : [(String, (LoggerTests) -> () throws -> Void)] {
return [
("testDefaultLoggerIdentity", testDefaultLoggerIdentity),
("testHierarchy", testHierarchy),
("testDetachedLogger", testDetachedLogger),
("testLogLevels", testLogLevels),
]
}
}
9 changes: 8 additions & 1 deletion Tests/EvergreenTests/LoggingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,12 @@ class LoggingTests: StenographyTestCase {
XCTAssert(records[expectedRecordCount - 1].description.contains(message))
XCTAssert(records[expectedRecordCount - 1].description.contains("TIME"))
}


static var allTests : [(String, (LoggerTests) -> () throws -> Void)] {
return [
("testLogLevels", testLogLevels),
("testErrorLogging", testErrorLogging),
("testTimeLogging", testTimeLogging),
]
}
}
7 changes: 7 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import XCTest
@testable import EvergreenTests

XCTMain([
testCase(LoggerTests.allTests),
testCase(LoggingTests.allTests),
])

0 comments on commit 8f0ffc4

Please sign in to comment.