File tree Expand file tree Collapse file tree 8 files changed +53
-3
lines changed Expand file tree Collapse file tree 8 files changed +53
-3
lines changed Original file line number Diff line number Diff line change 1
1
#[[
2
2
This source file is part of the Swift Numerics open source project
3
3
4
- Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
4
+ Copyright (c) 2019-2021 Apple Inc. and the Swift Numerics project authors
5
5
Licensed under Apache License v2.0 with Runtime Library Exception
6
6
7
7
See https://swift.org/LICENSE.txt for license information
8
8
#]]
9
9
10
10
add_subdirectory (_NumericsShims )
11
11
add_subdirectory (ComplexModule )
12
+ add_subdirectory (IntegerUtilities )
12
13
add_subdirectory (Numerics )
13
14
add_subdirectory (RealModule )
14
15
if (BUILD_TESTING )
Original file line number Diff line number Diff line change
1
+ #[[
2
+ This source file is part of the Swift Numerics open source project
3
+
4
+ Copyright (c) 2019-2021 Apple Inc. and the Swift Numerics project authors
5
+ Licensed under Apache License v2.0 with Runtime Library Exception
6
+
7
+ See https://swift.org/LICENSE.txt for license information
8
+ #]]
9
+
10
+ add_library (IntegerUtilities
11
+ Rotate.swift )
12
+ set_target_properties (IntegerUtilities PROPERTIES
13
+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
14
+
15
+ _install_target (IntegerUtilities )
16
+ set_property (GLOBAL APPEND PROPERTY SWIFT_NUMERICS_EXPORTS IntegerUtilities )
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ target_compile_options(Numerics PUBLIC
20
20
-Xfrontend -validate-tbd-against-ir=none )
21
21
target_link_libraries (Numerics PUBLIC
22
22
ComplexModule
23
+ IntegerUtilities
23
24
RealModule )
24
25
25
26
Original file line number Diff line number Diff line change 10
10
//===----------------------------------------------------------------------===//
11
11
12
12
// A module that re-exports the complete Swift Numerics public API.
13
- @_exported import RealModule
14
13
@_exported import ComplexModule
14
+ @_exported import IntegerUtilities
15
+ @_exported import RealModule
Original file line number Diff line number Diff line change @@ -12,12 +12,14 @@ find_package(Foundation CONFIG QUIET)
12
12
find_package (XCTest CONFIG QUIET )
13
13
14
14
add_subdirectory (ComplexTests )
15
+ add_subdirectory (IntegerUtilitiesTests )
15
16
add_subdirectory (RealTests )
16
17
17
18
add_executable (SwiftNumericsTestRunner
18
19
WindowsMain.swift )
19
20
target_link_libraries (SwiftNumericsTestRunner PRIVATE
20
21
ComplexTests
22
+ IntegerUtilitiesTests
21
23
RealTests )
22
24
23
25
add_test (NAME SwiftNumericsTestRunner
Original file line number Diff line number Diff line change
1
+ #[[
2
+ This source file is part of the Swift Numerics open source project
3
+
4
+ Copyright (c) 2019-2021 Apple Inc. and the Swift Numerics project authors
5
+ Licensed under Apache License v2.0 with Runtime Library Exception
6
+
7
+ See https://swift.org/LICENSE.txt for license information
8
+ #]]
9
+
10
+ add_library (IntegerUtilitiesTests
11
+ RotateTests.swift )
12
+ target_compile_options (IntegerUtilitiesTests PRIVATE
13
+ -enable-testing )
14
+ target_link_libraries (IntegerUtilitiesTests PUBLIC
15
+ $< $< NOT:$< PLATFORM_ID:Darwin> > :Foundation>
16
+ Numerics
17
+ XCTest )
18
+
Original file line number Diff line number Diff line change 13
13
import IntegerUtilities
14
14
import XCTest
15
15
16
- final class IntegerUtilitiesTests : XCTestCase {
16
+ final class RotateTests : XCTestCase {
17
17
func testRotateUInt8( ) {
18
18
let x : UInt8 = 0b10011100
19
19
XCTAssertEqual ( 0b01001110 , x. rotated ( right: - 7 ) )
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ import RealTests
18
18
@testable
19
19
import ComplexTests
20
20
21
+ @testable
22
+ import IntegerUtilitiesTests
23
+
21
24
extension ComplexTests . ApproximateEqualityTests {
22
25
static var all = testCase ( [
23
26
( " testFloat " , ComplexTests . ApproximateEqualityTests. testFloat) ,
@@ -80,13 +83,21 @@ extension PropertyTests {
80
83
] )
81
84
}
82
85
86
+ extension RotateTests {
87
+ static var all = testCase ( [
88
+ ( " testRotateUInt8 " , RotateTests . testRotateUInt8) ,
89
+ ( " testRotateInt16 " , RotateTests . testRotateInt16) ,
90
+ ] )
91
+ }
92
+
83
93
var testCases = [
84
94
ComplexTests . ApproximateEqualityTests. all,
85
95
RealTests . ApproximateEqualityTests. all,
86
96
ElementaryFunctionChecks . all,
87
97
IntegerExponentTests . all,
88
98
ArithmeticTests . all,
89
99
PropertyTests . all,
100
+ RotateTests . all,
90
101
]
91
102
92
103
#if swift(>=5.3) && canImport(_Differentiation)
You can’t perform that action at this time.
0 commit comments