Add Android support (#209)

This commit is contained in:
Andriy Druk authored and GitHub committed 2021-10-26 16:20:20 -07:00
1 parent 77192b9e21
commit 4e75f88c6a
4 files changed
+10 -8

No files matched your search

+7 -5
View File
@@ -990,15 +990,17 @@ public struct MultiplexLogHandler: LogHandler {
}
}
#if canImport(WASILibc) || os(Android)
internal typealias CFilePointer = OpaquePointer
#else
internal typealias CFilePointer = UnsafeMutablePointer<FILE>
#endif
/// A wrapper to facilitate `print`-ing to stderr and stdio that
/// ensures access to the underlying `FILE` is locked to prevent
/// cross-thread interleaving of output.
internal struct StdioOutputStream: TextOutputStream {
#if canImport(WASILibc)
internal let file: OpaquePointer
#else
internal let file: UnsafeMutablePointer<FILE>
#endif
internal let file: CFilePointer
internal let flushMode: FlushMode
internal func write(_ string: String) {
+1 -1
View File
@@ -22,7 +22,7 @@ import XCTest
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
#if os(Linux) || os(FreeBSD) || os(Windows)
#if os(Linux) || os(FreeBSD) || os(Windows) || os(Android)
@testable import LoggingTests
XCTMain([
+1 -1
View File
@@ -806,7 +806,7 @@ class LoggingTest: XCTestCase {
}
}
func withWriteReadFDsAndReadBuffer(_ body: (UnsafeMutablePointer<FILE>, CInt, UnsafeMutablePointer<Int8>) -> Void) {
func withWriteReadFDsAndReadBuffer(_ body: (CFilePointer, CInt, UnsafeMutablePointer<Int8>) -> Void) {
var fds: [Int32] = [-1, -1]
#if os(Windows)
fds.withUnsafeMutableBufferPointer {
+1 -1
View File
@@ -94,7 +94,7 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
file.write header(fileName)
file.write "\n"
file.write "#if os(Linux) || os(FreeBSD) || os(Windows)\n"
file.write "#if os(Linux) || os(FreeBSD) || os(Windows) || os(Android)\n"
for testSubDirectory in allTestSubDirectories.sort { |x, y| x <=> y }
file.write '@testable import ' + testSubDirectory + "\n"
end