Skip to content

Commit

Permalink
Merge pull request #139 from dn-m/linux
Browse files Browse the repository at this point in the history
Add Linux support
  • Loading branch information
jsbean authored Aug 13, 2018
2 parents 4758e14 + 8436738 commit 2ac5647
Show file tree
Hide file tree
Showing 12 changed files with 612 additions and 16 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
os:
- osx
- linux
language: generic
sudo: required
dist: trusty
osx_image: xcode9
install:
- 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
- sudo installer -pkg swift-4.2-DEVELOPMENT-SNAPSHOT-2018-05-30-a-osx.pkg -target /
- export PATH="/Library/Developer/Toolchains/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-05-30-a.xctoolchain/usr/bin:$PATH"
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
env:
- SWIFT_VERSION=DEVELOPMENT-SNAPSHOT-2018-05-30-a
script:
- swift build
- swift package update
- swift test
after_success:
- git clone https://github.com/dn-m/Documentarian && cd Documentarian
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/dn-m/PerformanceTesting",
"state": {
"branch": null,
"revision": "b76715a574872e29fe24f70b45f14c7e1bccf170",
"version": "0.2.0"
"revision": "d48417c837b1a029dd9567dfa7b5ee3cfa9a0ec7",
"version": "0.3.0"
}
}
]
Expand Down
2 changes: 0 additions & 2 deletions Sources/DataStructures/Wrapping/FloatWrapping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// Copyright © 2016 James Bean. All rights reserved.
//

import Foundation

// TODO: Add doc comments.
// - Wrap global functions as static methods in extensions, where possible.
public protocol FloatWrapping:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import Algebra

class AccumulatePerformanceTests: XCTestCase {

func randomInt(max: Int) -> Int {
return Int(arc4random_uniform(UInt32(max)))
}

func testAccumulatingProductLinear() {
let benchmark = Benchmark.nonMutating(
setup: { Array((0..<$0).map { Int.random(in: 0...$0) } ) },
Expand Down
15 changes: 15 additions & 0 deletions Tests/AlgebraPerformanceTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import XCTest

extension AccumulatePerformanceTests {
static let __allTests = [
("testAccumulatingProductLinear", testAccumulatingProductLinear),
]
}

#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(AccumulatePerformanceTests.__allTests),
]
}
#endif
25 changes: 25 additions & 0 deletions Tests/AlgebraTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import XCTest

extension AccumulateTests {
static let __allTests = [
("testAccumulatingProduct", testAccumulatingProduct),
("testFloatArrayAccumulatingSum", testFloatArrayAccumulatingSum),
("testIntArrayAccumulatingSum", testIntArrayAccumulatingSum),
]
}

extension SequenceAlgebraTests {
static let __allTests = [
("testSetIntersections", testSetIntersections),
("testSumOfAdditiveSemigroup", testSumOfAdditiveSemigroup),
]
}

#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(AccumulateTests.__allTests),
testCase(SequenceAlgebraTests.__allTests),
]
}
#endif
15 changes: 15 additions & 0 deletions Tests/AlgorithmsPerformanceTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import XCTest

extension StableSortPerformanceTests {
static let __allTests = [
("testStableSort", testStableSort),
]
}

#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(StableSortPerformanceTests.__allTests),
]
}
#endif
73 changes: 73 additions & 0 deletions Tests/AlgorithmsTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import XCTest

extension CombinatoricsTests {
static let __allTests = [
("testCartesianProductOfTwoArrays", testCartesianProductOfTwoArrays),
("testPermutations", testPermutations),
("testPermutationsEmpty", testPermutationsEmpty),
]
}

extension OrderedTests {
static let __allTests = [
("testOrderedEqual", testOrderedEqual),
("testOrderInOrder", testOrderInOrder),
("testOrderNeedsOrdering", testOrderNeedsOrdering),
]
}

extension RotateTests {
static let __allTests = [
("testRotateBy0", testRotateBy0),
("testRotateBy1", testRotateBy1),
("testRotateByGreaterThanCount", testRotateByGreaterThanCount),
("testRotateByNegative1", testRotateByNegative1),
]
}

extension SplitTests {
static let __allTests = [
("testSplitAndExtractEmpty", testSplitAndExtractEmpty),
("testSplitAndExtractMutlple", testSplitAndExtractMutlple),
("testSplitAndExtractSingle", testSplitAndExtractSingle),
]
}

extension StableSortTests {
static let __allTests = [
("testStableSort", testStableSort),
]
}

extension SwapTests {
static let __allTests = [
("testImmutableSwapped", testImmutableSwapped),
("testImmutableSwappedWithPredicateFalse", testImmutableSwappedWithPredicateFalse),
("testImmutableSwappedWithPredicateTrue", testImmutableSwappedWithPredicateTrue),
("testInoutSwapWithPredicateFalse", testInoutSwapWithPredicateFalse),
("testInoutSwapWithPredicateTrue", testInoutSwapWithPredicateTrue),
]
}

extension TupleMapTests {
static let __allTests = [
("testMapAB", testMapAB),
("testMapABC", testMapABC),
("testMapTupleAB", testMapTupleAB),
("testMapTupleABC", testMapTupleABC),
]
}

#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(CombinatoricsTests.__allTests),
testCase(OrderedTests.__allTests),
testCase(RotateTests.__allTests),
testCase(SplitTests.__allTests),
testCase(StableSortTests.__allTests),
testCase(SwapTests.__allTests),
testCase(TupleMapTests.__allTests),
]
}
#endif
16 changes: 16 additions & 0 deletions Tests/DataStructuresPerformanceTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import XCTest

extension BinaryHeapPerformanceTests {
static let __allTests = [
("testInsert_O_1", testInsert_O_1),
("testPop_O_1", testPop_O_1),
]
}

#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(BinaryHeapPerformanceTests.__allTests),
]
}
#endif
Loading

0 comments on commit 2ac5647

Please sign in to comment.