Skip to content

Commit 2ac5647

Browse files
authored
Merge pull request #139 from dn-m/linux
Add Linux support
2 parents 4758e14 + 8436738 commit 2ac5647

File tree

12 files changed

+612
-16
lines changed

12 files changed

+612
-16
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
os:
22
- osx
3+
- linux
34
language: generic
45
sudo: required
56
dist: trusty
67
osx_image: xcode9
78
install:
8-
- wget https://swift.org/builds/swift-4.2-branch/xcode/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-05-30-a/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-05-30-a-osx.pkg
9-
- sudo installer -pkg swift-4.2-DEVELOPMENT-SNAPSHOT-2018-05-30-a-osx.pkg -target /
10-
- export PATH="/Library/Developer/Toolchains/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-05-30-a.xctoolchain/usr/bin:$PATH"
9+
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
10+
env:
11+
- SWIFT_VERSION=DEVELOPMENT-SNAPSHOT-2018-05-30-a
1112
script:
12-
- swift build
13+
- swift package update
1314
- swift test
1415
after_success:
1516
- git clone https://github.com/dn-m/Documentarian && cd Documentarian

Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/dn-m/PerformanceTesting",
77
"state": {
88
"branch": null,
9-
"revision": "b76715a574872e29fe24f70b45f14c7e1bccf170",
10-
"version": "0.2.0"
9+
"revision": "d48417c837b1a029dd9567dfa7b5ee3cfa9a0ec7",
10+
"version": "0.3.0"
1111
}
1212
}
1313
]

Sources/DataStructures/Wrapping/FloatWrapping.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
// Copyright © 2016 James Bean. All rights reserved.
77
//
88

9-
import Foundation
10-
119
// TODO: Add doc comments.
1210
// - Wrap global functions as static methods in extensions, where possible.
1311
public protocol FloatWrapping:

Tests/AlgebraPerformanceTests/AccumulatePerformanceTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import Algebra
1212

1313
class AccumulatePerformanceTests: XCTestCase {
1414

15-
func randomInt(max: Int) -> Int {
16-
return Int(arc4random_uniform(UInt32(max)))
17-
}
18-
1915
func testAccumulatingProductLinear() {
2016
let benchmark = Benchmark.nonMutating(
2117
setup: { Array((0..<$0).map { Int.random(in: 0...$0) } ) },
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import XCTest
2+
3+
extension AccumulatePerformanceTests {
4+
static let __allTests = [
5+
("testAccumulatingProductLinear", testAccumulatingProductLinear),
6+
]
7+
}
8+
9+
#if !os(macOS)
10+
public func __allTests() -> [XCTestCaseEntry] {
11+
return [
12+
testCase(AccumulatePerformanceTests.__allTests),
13+
]
14+
}
15+
#endif
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import XCTest
2+
3+
extension AccumulateTests {
4+
static let __allTests = [
5+
("testAccumulatingProduct", testAccumulatingProduct),
6+
("testFloatArrayAccumulatingSum", testFloatArrayAccumulatingSum),
7+
("testIntArrayAccumulatingSum", testIntArrayAccumulatingSum),
8+
]
9+
}
10+
11+
extension SequenceAlgebraTests {
12+
static let __allTests = [
13+
("testSetIntersections", testSetIntersections),
14+
("testSumOfAdditiveSemigroup", testSumOfAdditiveSemigroup),
15+
]
16+
}
17+
18+
#if !os(macOS)
19+
public func __allTests() -> [XCTestCaseEntry] {
20+
return [
21+
testCase(AccumulateTests.__allTests),
22+
testCase(SequenceAlgebraTests.__allTests),
23+
]
24+
}
25+
#endif
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import XCTest
2+
3+
extension StableSortPerformanceTests {
4+
static let __allTests = [
5+
("testStableSort", testStableSort),
6+
]
7+
}
8+
9+
#if !os(macOS)
10+
public func __allTests() -> [XCTestCaseEntry] {
11+
return [
12+
testCase(StableSortPerformanceTests.__allTests),
13+
]
14+
}
15+
#endif
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import XCTest
2+
3+
extension CombinatoricsTests {
4+
static let __allTests = [
5+
("testCartesianProductOfTwoArrays", testCartesianProductOfTwoArrays),
6+
("testPermutations", testPermutations),
7+
("testPermutationsEmpty", testPermutationsEmpty),
8+
]
9+
}
10+
11+
extension OrderedTests {
12+
static let __allTests = [
13+
("testOrderedEqual", testOrderedEqual),
14+
("testOrderInOrder", testOrderInOrder),
15+
("testOrderNeedsOrdering", testOrderNeedsOrdering),
16+
]
17+
}
18+
19+
extension RotateTests {
20+
static let __allTests = [
21+
("testRotateBy0", testRotateBy0),
22+
("testRotateBy1", testRotateBy1),
23+
("testRotateByGreaterThanCount", testRotateByGreaterThanCount),
24+
("testRotateByNegative1", testRotateByNegative1),
25+
]
26+
}
27+
28+
extension SplitTests {
29+
static let __allTests = [
30+
("testSplitAndExtractEmpty", testSplitAndExtractEmpty),
31+
("testSplitAndExtractMutlple", testSplitAndExtractMutlple),
32+
("testSplitAndExtractSingle", testSplitAndExtractSingle),
33+
]
34+
}
35+
36+
extension StableSortTests {
37+
static let __allTests = [
38+
("testStableSort", testStableSort),
39+
]
40+
}
41+
42+
extension SwapTests {
43+
static let __allTests = [
44+
("testImmutableSwapped", testImmutableSwapped),
45+
("testImmutableSwappedWithPredicateFalse", testImmutableSwappedWithPredicateFalse),
46+
("testImmutableSwappedWithPredicateTrue", testImmutableSwappedWithPredicateTrue),
47+
("testInoutSwapWithPredicateFalse", testInoutSwapWithPredicateFalse),
48+
("testInoutSwapWithPredicateTrue", testInoutSwapWithPredicateTrue),
49+
]
50+
}
51+
52+
extension TupleMapTests {
53+
static let __allTests = [
54+
("testMapAB", testMapAB),
55+
("testMapABC", testMapABC),
56+
("testMapTupleAB", testMapTupleAB),
57+
("testMapTupleABC", testMapTupleABC),
58+
]
59+
}
60+
61+
#if !os(macOS)
62+
public func __allTests() -> [XCTestCaseEntry] {
63+
return [
64+
testCase(CombinatoricsTests.__allTests),
65+
testCase(OrderedTests.__allTests),
66+
testCase(RotateTests.__allTests),
67+
testCase(SplitTests.__allTests),
68+
testCase(StableSortTests.__allTests),
69+
testCase(SwapTests.__allTests),
70+
testCase(TupleMapTests.__allTests),
71+
]
72+
}
73+
#endif
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import XCTest
2+
3+
extension BinaryHeapPerformanceTests {
4+
static let __allTests = [
5+
("testInsert_O_1", testInsert_O_1),
6+
("testPop_O_1", testPop_O_1),
7+
]
8+
}
9+
10+
#if !os(macOS)
11+
public func __allTests() -> [XCTestCaseEntry] {
12+
return [
13+
testCase(BinaryHeapPerformanceTests.__allTests),
14+
]
15+
}
16+
#endif

0 commit comments

Comments
 (0)