Skip to content

Commit bc17ae6

Browse files
Merge pull request #201 from stephentyrone/integer-utils-readme
Resolve warnings in 5.5 build, add skeleton readme for integer utilities
2 parents b6f4c44 + e22ff86 commit bc17ae6

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

Package.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,41 +59,39 @@ let package = Package(
5959
.target(
6060
name: "_TestSupport",
6161
dependencies: ["Numerics"],
62-
exclude: excludedFilenames
62+
exclude: ["CMakeLists.txt"]
6363
),
6464

6565
// MARK: - Unit test bundles
6666
.testTarget(
6767
name: "ComplexTests",
6868
dependencies: ["_TestSupport"],
69-
exclude: excludedFilenames
69+
exclude: ["CMakeLists.txt"]
7070
),
7171

7272
.testTarget(
7373
name: "IntegerUtilitiesTests",
7474
dependencies: ["IntegerUtilities"],
75-
exclude: excludedFilenames
75+
exclude: ["CMakeLists.txt"]
7676
),
7777

7878
.testTarget(
7979
name: "RealTests",
8080
dependencies: ["_TestSupport"],
81-
exclude: excludedFilenames
81+
exclude: ["CMakeLists.txt"]
8282
),
8383

8484
// MARK: - Test executables
8585
.target(
8686
name: "ComplexLog",
8787
dependencies: ["Numerics", "_TestSupport"],
88-
path: "Tests/Executable/ComplexLog",
89-
exclude: excludedFilenames
88+
path: "Tests/Executable/ComplexLog"
9089
),
9190

9291
.target(
9392
name: "ComplexLog1p",
9493
dependencies: ["Numerics", "_TestSupport"],
95-
path: "Tests/Executable/ComplexLog1p",
96-
exclude: excludedFilenames
94+
path: "Tests/Executable/ComplexLog1p"
9795
)
9896
]
9997
)

Sources/IntegerUtilities/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ See https://swift.org/LICENSE.txt for license information
88
#]]
99

1010
add_library(IntegerUtilities
11+
GCD.swift
1112
Rotate.swift)
1213
set_target_properties(IntegerUtilities PROPERTIES
1314
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

Sources/IntegerUtilities/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Integer Utilities
2+
3+
## Utilities defined for `BinaryInteger`
4+
5+
The following API are defined for all integer types conforming to `BinaryInteger`:
6+
7+
- The `gcd(_:_:)` free function implements the _Greatest Common Divisor_
8+
operation.
9+
10+
## Utilities defined for `FixedWidthInteger`
11+
12+
- The `rotated(right:)` and `rotated(left:)` methods implement _bitwise
13+
rotation_ for signed and unsigned integer types. The count parameter may
14+
be any `BinaryInteger` type.

Tests/IntegerUtilitiesTests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ See https://swift.org/LICENSE.txt for license information
88
#]]
99

1010
add_library(IntegerUtilitiesTests
11+
GCDTests.swift
1112
RotateTests.swift)
1213
target_compile_options(IntegerUtilitiesTests PRIVATE
1314
-enable-testing)

Tests/WindowsMain.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ extension RotateTests {
9090
])
9191
}
9292

93+
extension IntegerUtilitiesGCDTests {
94+
static var all = testCase([
95+
("testGCDInt", IntegerUtilitiesGCDTests.testGCDInt),
96+
])
97+
}
98+
9399
var testCases = [
94100
ComplexTests.ApproximateEqualityTests.all,
95101
RealTests.ApproximateEqualityTests.all,
@@ -98,6 +104,7 @@ var testCases = [
98104
ArithmeticTests.all,
99105
PropertyTests.all,
100106
RotateTests.all,
107+
IntegerUtilitiesGCDTests.all,
101108
]
102109

103110
#if swift(>=5.3) && canImport(_Differentiation)

0 commit comments

Comments
 (0)