From 2fae6a86e3286051b93c28f73e0e6afba8acab25 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 4 Mar 2024 14:24:17 +0000 Subject: [PATCH 1/4] Remove unused `LinuxMain.swift` and `WindowsMain.swift` These files are no longer needed, as `swift test` enables test discovery by default. --- Tests/WindowsMain.swift | 194 ---------------------------------------- 1 file changed, 194 deletions(-) delete mode 100644 Tests/WindowsMain.swift diff --git a/Tests/WindowsMain.swift b/Tests/WindowsMain.swift deleted file mode 100644 index 4c3c65b..0000000 --- a/Tests/WindowsMain.swift +++ /dev/null @@ -1,194 +0,0 @@ -//===--- WindowsMain.swift ------------------------------------*- swift -*-===// -// -// This source file is part of the Swift Numerics open source project -// -// Copyright (c) 2019-2021 Apple Inc. and the Swift Numerics project authors -// Licensed under Apache License v2.0 with Runtime Library Exception -// -// See https://swift.org/LICENSE.txt for license information -// -//===----------------------------------------------------------------------===// - -#if os(Windows) -import XCTest - -@testable -import RealTests - -@testable -import ComplexTests - -@testable -import IntegerUtilitiesTests - -extension ComplexTests.ApproximateEqualityTests { - static var all = testCase([ - ("testFloat", ComplexTests.ApproximateEqualityTests.testFloat), - ("testDouble", ComplexTests.ApproximateEqualityTests.testDouble), - ]) -} - -extension RealTests.ApproximateEqualityTests { - static var all = testCase([ - ("testFloat", RealTests.ApproximateEqualityTests.testFloat), - ("testDouble", RealTests.ApproximateEqualityTests.testDouble), - ]) -} - -#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64)) -extension ElementaryFunctionChecks { - static var all = testCase([ - ("testFloat16", ElementaryFunctionChecks.testFloat16), - ("testFloat", ElementaryFunctionChecks.testFloat), - ("testDouble", ElementaryFunctionChecks.testDouble), - ]) -} - -extension IntegerExponentTests { - static var all = testCase([ - ("testFloat16", IntegerExponentTests.testFloat16), - ("testFloat", IntegerExponentTests.testFloat), - ("testDouble", IntegerExponentTests.testDouble), - ]) -} -#else -extension ElementaryFunctionChecks { - static var all = testCase([ - ("testFloat", ElementaryFunctionChecks.testFloat), - ("testDouble", ElementaryFunctionChecks.testDouble), - ]) -} - -extension IntegerExponentTests { - static var all = testCase([ - ("testFloat", IntegerExponentTests.testFloat), - ("testDouble", IntegerExponentTests.testDouble), - ]) -} -#endif - -extension RealTests.AugmentedArithmeticTests { - static var all = testCase([ - ("testTwoSum", RealTests.AugmentedArithmeticTests.testTwoSum), - ]) -} - -extension RealTests.RelaxedArithmeticTests { - static var all = testCase([ - ("testRelaxedArithmetic", RealTests.RelaxedArithmeticTests.testRelaxedArithmetic), - ]) -} - -extension ArithmeticTests { - static var all = testCase([ - ("testPolar", ArithmeticTests.testPolar), - ("testBaudinSmith", ArithmeticTests.testBaudinSmith), - ("testDivisionByZero", ArithmeticTests.testDivisionByZero), - ]) -} - -extension PropertyTests { - static var all = testCase([ - ("testProperties", PropertyTests.testProperties), - ("testEquatableHashable", PropertyTests.testEquatableHashable), - ("testCodable", PropertyTests.testCodable), - ]) -} - -extension IntegerUtilitiesDivideTests { - static var all = testCase([ - ("testDivideInt8", IntegerUtilitiesDivideTests.testDivideInt8), - ("testDivideInt", IntegerUtilitiesDivideTests.testDivideInt), - ("testDivideUInt8", IntegerUtilitiesDivideTests.testDivideUInt8), - ("testDivideStochasticInt8", IntegerUtilitiesDivideTests.testDivideStochasticInt8), - ("testDivideStochasticUInt32", IntegerUtilitiesDivideTests.testDivideStochasticUInt32), - ("testRemainderByMinusOne", IntegerUtilitiesDivideTests.testRemainderByMinusOne), - ]) -} - -extension IntegerUtilitiesGCDTests { - static var all = testCase([ - ("testGCDInt", IntegerUtilitiesGCDTests.testGCDInt), - ]) -} - -extension IntegerUtilitiesRotateTests { - static var all = testCase([ - ("testRotateUInt8", IntegerUtilitiesRotateTests.testRotateUInt8), - ("testRotateInt16", IntegerUtilitiesRotateTests.testRotateInt16), - ]) -} - -extension IntegerUtilitiesSaturatingTests { - static var all = testCase([ - ("testSaturatingAddSigned", IntegerUtilitiesSaturatingTests.testSaturatingAddSigned), - ("testSaturatingSubSigned", IntegerUtilitiesSaturatingTests.testSaturatingSubSigned), - ("testSaturatingNegSigned", IntegerUtilitiesSaturatingTests.testSaturatingNegSigned), - ("testSaturatingMulSigned", IntegerUtilitiesSaturatingTests.testSaturatingMulSigned), - ("testSaturatingAddUnsigned", IntegerUtilitiesSaturatingTests.testSaturatingAddUnsigned), - ("testSaturatingSubUnsigned", IntegerUtilitiesSaturatingTests.testSaturatingSubUnsigned), - ("testSaturatingNegUnsigned", IntegerUtilitiesSaturatingTests.testSaturatingNegUnsigned), - ("testSaturatingMulUnsigned", IntegerUtilitiesSaturatingTests.testSaturatingMulUnsigned), - ("testSaturatingShifts", IntegerUtilitiesSaturatingTests.testSaturatingShifts), - ("testEdgeCaseForNegativeCount", IntegerUtilitiesSaturatingTests.testEdgeCaseForNegativeCount) - ]) -} - -extension IntegerUtilitiesShiftTests { - static var all = testCase([ - ("testRoundingShifts", IntegerUtilitiesShiftTests.testRoundingShifts), - ("testStochasticShifts", IntegerUtilitiesShiftTests.testStochasticShifts), - ]) -} - -extension IntegerUtilitiesTests.DoubleWidthTests { - static var all = testCase([ - ("testArithmetic_Signed", IntegerUtilitiesTests.DoubleWidthTests.testArithmetic_Signed), - ("testArithmetic_Unsigned", IntegerUtilitiesTests.DoubleWidthTests.testArithmetic_Unsigned), - ("testBitwise_LeftAndRightShifts", IntegerUtilitiesTests.DoubleWidthTests.testBitwise_LeftAndRightShifts), - ("testCompileTime_SR_6947", IntegerUtilitiesTests.DoubleWidthTests.testCompileTime_SR_6947), - ("testConditionalConformance", IntegerUtilitiesTests.DoubleWidthTests.testConditionalConformance), - ("testConversions", IntegerUtilitiesTests.DoubleWidthTests.testConversions), - ("testConversions_Exact", IntegerUtilitiesTests.DoubleWidthTests.testConversions_Exact), - ("testConversions_SignedMax", IntegerUtilitiesTests.DoubleWidthTests.testConversions_SignedMax), - ("testConversions_SignedMin", IntegerUtilitiesTests.DoubleWidthTests.testConversions_SignedMin), - ("testConversions_ToAndFromString_Binary", IntegerUtilitiesTests.DoubleWidthTests.testConversions_ToAndFromString_Binary), - ("testConversions_ToAndFromString_Decimal", IntegerUtilitiesTests.DoubleWidthTests.testConversions_ToAndFromString_Decimal), - ("testConversions_ToAndFromString_Hexadecimal", IntegerUtilitiesTests.DoubleWidthTests.testConversions_ToAndFromString_Hexadecimal), - ("testConversions_UnsignedMax", IntegerUtilitiesTests.DoubleWidthTests.testConversions_UnsignedMax), - ("testConversions_UnsignedMin", IntegerUtilitiesTests.DoubleWidthTests.testConversions_UnsignedMin), - ("testDivision_ByMinusOne", IntegerUtilitiesTests.DoubleWidthTests.testDivision_ByMinusOne), - ("testDivision_ByZero", IntegerUtilitiesTests.DoubleWidthTests.testDivision_ByZero), - ("testInitialization", IntegerUtilitiesTests.DoubleWidthTests.testInitialization), - ("testInitialization_Overflow", IntegerUtilitiesTests.DoubleWidthTests.testInitialization_Overflow), - ("testLiterals", IntegerUtilitiesTests.DoubleWidthTests.testLiterals), - ("testLiterals_Underflow", IntegerUtilitiesTests.DoubleWidthTests.testLiterals_Underflow), - ("testMagnitude", IntegerUtilitiesTests.DoubleWidthTests.testMagnitude), - ("testMultipleOf", IntegerUtilitiesTests.DoubleWidthTests.testMultipleOf), - ("testMultiplication_ByMinusOne", IntegerUtilitiesTests.DoubleWidthTests.testMultiplication_ByMinusOne), - ("testNested", IntegerUtilitiesTests.DoubleWidthTests.testNested), - ("testRemainder_ByMinusOne", IntegerUtilitiesTests.DoubleWidthTests.testRemainder_ByMinusOne), - ("testRemainder_ByZero", IntegerUtilitiesTests.DoubleWidthTests.testRemainder_ByZero), - ("testTwoWords", IntegerUtilitiesTests.DoubleWidthTests.testTwoWords), - ("testWords", IntegerUtilitiesTests.DoubleWidthTests.testWords), - ]) -} - -var testCases = [ - ComplexTests.ApproximateEqualityTests.all, - RealTests.ApproximateEqualityTests.all, - ElementaryFunctionChecks.all, - IntegerExponentTests.all, - ArithmeticTests.all, - PropertyTests.all, - IntegerUtilitiesDivideTests.all, - IntegerUtilitiesGCDTests.all, - IntegerUtilitiesRotateTests.all, - IntegerUtilitiesShiftTests.all, - IntegerUtilitiesSaturatingTests.all, - IntegerUtilitiesTests.DoubleWidthTests.all, -] - -XCTMain(testCases) - -#endif From 0599b610d981e295cde17c72a09e1e5efbbe01f2 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 4 Mar 2024 14:24:44 +0000 Subject: [PATCH 2/4] Delete Tests/LinuxMain.swift --- Tests/LinuxMain.swift | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 Tests/LinuxMain.swift diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift deleted file mode 100644 index 17f4312..0000000 --- a/Tests/LinuxMain.swift +++ /dev/null @@ -1,12 +0,0 @@ -//===--- LinuxMain.swift --------------------------------------*- swift -*-===// -// -// This source file is part of the Swift Numerics open source project -// -// Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors -// Licensed under Apache License v2.0 with Runtime Library Exception -// -// See https://swift.org/LICENSE.txt for license information -// -//===----------------------------------------------------------------------===// - -fatalError("Use --enable-test-discovery to run Swift Numerics tests on Linux.") From 43e0f5b0265b0cca0841b1f8ef77f4d6c6fb0668 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 4 Mar 2024 15:49:07 +0000 Subject: [PATCH 3/4] Delete Tests/CMakeLists.txt --- Tests/CMakeLists.txt | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 Tests/CMakeLists.txt diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt deleted file mode 100644 index b842677..0000000 --- a/Tests/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -#[[ -This source file is part of the Swift Numerics open source project - -Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors -Licensed under Apache License v2.0 with Runtime Library Exception - -See https://swift.org/LICENSE.txt for license information -#]] - -find_package(dispatch CONFIG QUIET) -find_package(Foundation CONFIG QUIET) -find_package(XCTest CONFIG QUIET) - -add_subdirectory(ComplexTests) -add_subdirectory(IntegerUtilitiesTests) -add_subdirectory(RealTests) - -add_executable(SwiftNumericsTestRunner - WindowsMain.swift) -target_link_libraries(SwiftNumericsTestRunner PRIVATE - ComplexTests - IntegerUtilitiesTests - RealTests) - -add_test(NAME SwiftNumericsTestRunner - COMMAND SwiftNumericsTestRunner) From 4e905b38b720bbba3d67b95ed02fc87dab1cdd4d Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 4 Mar 2024 15:49:27 +0000 Subject: [PATCH 4/4] Update CMakeLists.txt --- CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0e8058..7e126bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,9 +22,6 @@ include(CTest) include(SwiftSupport) add_subdirectory(Sources) -if(BUILD_TESTING) - add_subdirectory(Tests) -endif() get_property(SWIFT_NUMERICS_EXPORTS GLOBAL PROPERTY SWIFT_NUMERICS_EXPORTS) export(TARGETS ${SWIFT_NUMERICS_EXPORTS}