Skip to content

Commit 809f819

Browse files
dankogaiKoray Koska
authored and
Koray Koska
committed
Let Swift Package Manager support Linux, too (#6)
* update .gitignore * Support Linux on Swift Package Manager * fix as #6 (comment) * fix as #6 (comment)
1 parent 981c89b commit 809f819

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

LinuxMain.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import XCTest
2+
@testable import SipHashTests
3+
@testable import PrimitiveTypeTests
4+
@testable import SipHashableTests
5+
6+
XCTMain([
7+
testCase(SipHashTests.allTests),
8+
testCase(PrimitiveTypeTests.allTests),
9+
testCase(SipHashableTests.allTests),
10+
])

SipHashTests/PrimitiveTypeTests.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,4 +467,26 @@ class PrimitiveTypeTests: XCTestCase {
467467

468468
XCTAssertEqual(actual, expected)
469469
}
470+
//
471+
// you have to manually register linux tests here :-(
472+
//
473+
static var allTests = [
474+
("testBoolTrue", testBoolTrue),
475+
("testInt", testInt),
476+
("testUInt", testUInt),
477+
("testInt64", testInt64),
478+
("testUInt64", testUInt64),
479+
("testInt32", testInt32),
480+
("testUInt32", testUInt32),
481+
("testInt16", testInt16),
482+
("testUInt16", testUInt16),
483+
("testInt8", testInt8),
484+
("testUInt8", testUInt8),
485+
("testFloat", testFloat),
486+
("testDouble", testDouble),
487+
("testFloat80", testFloat80),
488+
// ("testCGFloat", testCGFloat), // missing in Linux
489+
("testOptional_nil", testOptional_nil),
490+
("testOptional_nonnil", testOptional_nonnil),
491+
]
470492
}

SipHashTests/SipHashTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,12 @@ class SipHashTests: XCTestCase {
140140
}
141141
}
142142
}
143+
//
144+
// you have to manually register linux tests here :-(
145+
//
146+
static var allTests = [
147+
("testVectors", testVectors),
148+
("testSplits", testSplits),
149+
("testDefaultKey", testDefaultKey),
150+
]
143151
}

SipHashTests/SipHashableTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,12 @@ class SipHashableTests: XCTestCase {
5656

5757
XCTAssertEqual(hash1, hash2)
5858
}
59+
//
60+
// you have to manually register linux tests here :-(
61+
//
62+
static var allTests = [
63+
("testBookHashValue", testBookHashValue),
64+
("testBookEquality", testBookEquality),
65+
("testAddSipHashable", testAddSipHashable),
66+
]
5967
}

0 commit comments

Comments
 (0)