diff --git a/CMakeLists.txt b/CMakeLists.txt index 21101ac..2770b0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ cmake_minimum_required(VERSION 3.19) project(swift-log LANGUAGES C Swift) -option(BUILD_TESTING "Build testing targets" OFF) option(BUILD_SHARED_LIBS "Build shared libraries by default" YES) set(CMAKE_Swift_LANGUAGE_VERSION 6) @@ -48,7 +47,6 @@ if(MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") endif() -include(CTest) include(GNUInstallDirs) include(SwiftSupport) @@ -58,8 +56,5 @@ if(NOT APPLE) endif() add_subdirectory(Sources) -if(BUILD_TESTING) - add_subdirectory(Tests) -endif() add_subdirectory(cmake/modules) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt deleted file mode 100644 index 4017fa1..0000000 --- a/Tests/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -#===----------------------------------------------------------------------===# -# -# This source file is part of the Swift Logging API open source project -# -# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors -# Licensed under Apache License v2.0 -# -# See LICENSE.txt for license information -# See CONTRIBUTORS.txt for the list of Swift Logging API project authors -# -# SPDX-License-Identifier: Apache-2.0 -# -#===----------------------------------------------------------------------===# - -add_subdirectory(LoggingTests) -add_subdirectory(InMemoryLoggingTests) diff --git a/Tests/InMemoryLoggingTests/CMakeLists.txt b/Tests/InMemoryLoggingTests/CMakeLists.txt deleted file mode 100644 index 0a6b404..0000000 --- a/Tests/InMemoryLoggingTests/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -#===----------------------------------------------------------------------===# -# -# This source file is part of the Swift Logging API open source project -# -# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors -# Licensed under Apache License v2.0 -# -# See LICENSE.txt for license information -# See CONTRIBUTORS.txt for the list of Swift Logging API project authors -# -# SPDX-License-Identifier: Apache-2.0 -# -#===----------------------------------------------------------------------===# - -add_library(InMemoryLoggingTests - InMemoryLogHandlerTests.swift) - -target_compile_options(InMemoryLoggingTests PRIVATE - ${SWIFT_LOG_COMMON_COMPILE_OPTIONS}) - -if(APPLE) - target_compile_options(InMemoryLoggingTests PRIVATE - "SHELL:-plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing") -endif() - -if(APPLE) - find_library(TESTING_FRAMEWORK Testing - PATHS "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" - NO_DEFAULT_PATH) - target_link_libraries(InMemoryLoggingTests PRIVATE InMemoryLogging Logging ${TESTING_FRAMEWORK}) -else() - target_link_libraries(InMemoryLoggingTests PRIVATE InMemoryLogging Logging Testing) -endif() diff --git a/Tests/LoggingTests/CMakeLists.txt b/Tests/LoggingTests/CMakeLists.txt deleted file mode 100644 index 2b812c0..0000000 --- a/Tests/LoggingTests/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -#===----------------------------------------------------------------------===# -# -# This source file is part of the Swift Logging API open source project -# -# Copyright (c) 2018-2026 Apple Inc. and the Swift Logging API project authors -# Licensed under Apache License v2.0 -# -# See LICENSE.txt for license information -# See CONTRIBUTORS.txt for the list of Swift Logging API project authors -# -# SPDX-License-Identifier: Apache-2.0 -# -#===----------------------------------------------------------------------===# - -add_library(LoggingTests - CompatibilityTest.swift - GlobalLoggingTest.swift - LocalLoggingTest.swift - LockTest.swift - LogEventTest.swift - LoggingTest.swift - MDCTest.swift - MetadataAttributesTest.swift - MetadataProviderTest.swift - MetadataValueInterpolationTest.swift - StreamLogHandlerTest.swift - SwiftLogNoOpLogHandlerTest.swift - TaskLocalLoggerTest.swift - TestLogger.swift - TestSendable.swift - SubDirectoryOfLoggingTests/EmitALogFromSubDirectory.swift) - -target_compile_options(LoggingTests PRIVATE - ${SWIFT_LOG_COMMON_COMPILE_OPTIONS}) - -if(APPLE) - target_compile_options(LoggingTests PRIVATE - "SHELL:-plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing") -endif() - -if(APPLE) - find_library(TESTING_FRAMEWORK Testing - PATHS "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" - NO_DEFAULT_PATH) - target_link_libraries(LoggingTests PRIVATE Logging ${TESTING_FRAMEWORK}) -else() - target_link_libraries(LoggingTests PRIVATE Logging Testing) -endif()