From 96df03d007a2b1a76f0b0b4479f2462a332cd38d Mon Sep 17 00:00:00 2001 From: Stephen Canon Date: Mon, 15 Apr 2024 10:07:12 -0400 Subject: [PATCH] Merge pull request #280 from MaxDesiatov/patch-1 Remove unused `LinuxMain.swift` and `WindowsMain.swift` --- CMakeLists.txt | 3 -- Tests/CMakeLists.txt | 24 --------- Tests/LinuxMain.swift | 12 ----- Tests/WindowsMain.swift | 109 ---------------------------------------- 4 files changed, 148 deletions(-) delete mode 100644 Tests/CMakeLists.txt delete mode 100644 Tests/LinuxMain.swift delete mode 100644 Tests/WindowsMain.swift 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} diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt deleted file mode 100644 index b879f0e..0000000 --- a/Tests/CMakeLists.txt +++ /dev/null @@ -1,24 +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(RealTests) - -add_executable(SwiftNumericsTestRunner - WindowsMain.swift) -target_link_libraries(SwiftNumericsTestRunner PRIVATE - ComplexTests - RealTests) - -add_test(NAME SwiftNumericsTestRunner - COMMAND SwiftNumericsTestRunner) 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.") diff --git a/Tests/WindowsMain.swift b/Tests/WindowsMain.swift deleted file mode 100644 index c0e6002..0000000 --- a/Tests/WindowsMain.swift +++ /dev/null @@ -1,109 +0,0 @@ -//===--- WindowsMain.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 -// -//===----------------------------------------------------------------------===// - -#if os(Windows) -import XCTest - -@testable -import RealTests - -@testable -import ComplexTests - -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 swift(>=5.4) && !((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 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), - ]) -} - -var testCases = [ - ComplexTests.ApproximateEqualityTests.all, - RealTests.ApproximateEqualityTests.all, - ElementaryFunctionChecks.all, - IntegerExponentTests.all, - ArithmeticTests.all, - PropertyTests.all, -] - -#if swift(>=5.3) && canImport(_Differentiation) -extension DifferentiableTests { - static var all = testCase([ - ("testComponentGetter", DifferentiableTests.testComponentGetter), - ("testInitializer", DifferentiableTests.testInitializer), - ("testConjugate", DifferentiableTests.testConjugate), - ("testArithmetics", DifferentiableTests.testArithmetics), - ]) -} - -testCases += [ - DifferentiableTests.all -] -#endif - -XCTMain(testCases) - -#endif