Merge pull request #201 from stephentyrone/integer-utils-readme

Resolve warnings in 5.5 build, add skeleton readme for integer utilities
This commit is contained in:
Stephen Canon authored and GitHub committed 2021-09-20 13:15:57 -04:00
commit bc17ae6a82
5 files changed
+29 -8

No files matched your search

+6 -8
View File
@@ -59,41 +59,39 @@ let package = Package(
.target(
name: "_TestSupport",
dependencies: ["Numerics"],
exclude: excludedFilenames
exclude: ["CMakeLists.txt"]
),
// MARK: - Unit test bundles
.testTarget(
name: "ComplexTests",
dependencies: ["_TestSupport"],
exclude: excludedFilenames
exclude: ["CMakeLists.txt"]
),
.testTarget(
name: "IntegerUtilitiesTests",
dependencies: ["IntegerUtilities"],
exclude: excludedFilenames
exclude: ["CMakeLists.txt"]
),
.testTarget(
name: "RealTests",
dependencies: ["_TestSupport"],
exclude: excludedFilenames
exclude: ["CMakeLists.txt"]
),
// MARK: - Test executables
.target(
name: "ComplexLog",
dependencies: ["Numerics", "_TestSupport"],
path: "Tests/Executable/ComplexLog",
exclude: excludedFilenames
path: "Tests/Executable/ComplexLog"
),
.target(
name: "ComplexLog1p",
dependencies: ["Numerics", "_TestSupport"],
path: "Tests/Executable/ComplexLog1p",
exclude: excludedFilenames
path: "Tests/Executable/ComplexLog1p"
)
]
)
+1
View File
@@ -8,6 +8,7 @@ See https://swift.org/LICENSE.txt for license information
#]]
add_library(IntegerUtilities
GCD.swift
Rotate.swift)
set_target_properties(IntegerUtilities PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
+14
View File
@@ -0,0 +1,14 @@
# Integer Utilities
## Utilities defined for `BinaryInteger`
The following API are defined for all integer types conforming to `BinaryInteger`:
- The `gcd(_:_:)` free function implements the _Greatest Common Divisor_
operation.
## Utilities defined for `FixedWidthInteger`
- The `rotated(right:)` and `rotated(left:)` methods implement _bitwise
rotation_ for signed and unsigned integer types. The count parameter may
be any `BinaryInteger` type.
@@ -8,6 +8,7 @@ See https://swift.org/LICENSE.txt for license information
#]]
add_library(IntegerUtilitiesTests
GCDTests.swift
RotateTests.swift)
target_compile_options(IntegerUtilitiesTests PRIVATE
-enable-testing)
+7
View File
@@ -90,6 +90,12 @@ extension RotateTests {
])
}
extension IntegerUtilitiesGCDTests {
static var all = testCase([
("testGCDInt", IntegerUtilitiesGCDTests.testGCDInt),
])
}
var testCases = [
ComplexTests.ApproximateEqualityTests.all,
RealTests.ApproximateEqualityTests.all,
@@ -98,6 +104,7 @@ var testCases = [
ArithmeticTests.all,
PropertyTests.all,
RotateTests.all,
IntegerUtilitiesGCDTests.all,
]
#if swift(>=5.3) && canImport(_Differentiation)