From 400bee7ecac39e5eb709e22d0e58e54bc7c3eff5 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 15 Apr 2024 15:28:34 +0800 Subject: [PATCH] Add test target for file provider testing Signed-off-by: Claudio Cambra --- .../FileProviderExtTests.swift | 35 ++++ .../project.pbxproj | 172 +++++++++++++++++- 2 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 shell_integration/MacOSX/NextcloudIntegration/FileProviderExtTests/FileProviderExtTests.swift diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExtTests/FileProviderExtTests.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExtTests/FileProviderExtTests.swift new file mode 100644 index 000000000..98bedc906 --- /dev/null +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExtTests/FileProviderExtTests.swift @@ -0,0 +1,35 @@ +// +// FileProviderExtTests.swift +// FileProviderExtTests +// +// Created by Claudio Cambra on 15/4/24. +// + +import XCTest + +final class FileProviderExtTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj index e830d9ac8..7456fe02d 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj +++ b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj @@ -34,6 +34,7 @@ 537630952B860D560026BFAB /* FPUIExtensionServiceSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 537630942B860D560026BFAB /* FPUIExtensionServiceSource.swift */; }; 537630972B860D920026BFAB /* FPUIExtensionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 537630962B860D920026BFAB /* FPUIExtensionService.swift */; }; 537630982B8612F00026BFAB /* FPUIExtensionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 537630962B860D920026BFAB /* FPUIExtensionService.swift */; }; + 5388E8AA2BCD0E0B00557E8A /* FileProviderExtTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5388E8A92BCD0E0B00557E8A /* FileProviderExtTests.swift */; }; 538E396A27F4765000FA63D5 /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */; }; 538E396D27F4765000FA63D5 /* FileProviderExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E396C27F4765000FA63D5 /* FileProviderExtension.swift */; }; 538E396F27F4765000FA63D5 /* FileProviderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E396E27F4765000FA63D5 /* FileProviderItem.swift */; }; @@ -75,6 +76,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 5388E8AB2BCD0E0B00557E8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C2B573951B1CD88000303B36 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C2B573B01B1CD91E00303B36; + remoteInfo = desktopclient; + }; 538E397427F4765000FA63D5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C2B573951B1CD88000303B36 /* Project object */; @@ -185,6 +193,8 @@ 537630922B85F4B00026BFAB /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; 537630942B860D560026BFAB /* FPUIExtensionServiceSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FPUIExtensionServiceSource.swift; sourceTree = ""; }; 537630962B860D920026BFAB /* FPUIExtensionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FPUIExtensionService.swift; sourceTree = ""; }; + 5388E8A72BCD0E0B00557E8A /* FileProviderExtTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FileProviderExtTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5388E8A92BCD0E0B00557E8A /* FileProviderExtTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderExtTests.swift; sourceTree = ""; }; 538E396727F4765000FA63D5 /* FileProviderExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FileProviderExt.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UniformTypeIdentifiers.framework; path = System/Library/Frameworks/UniformTypeIdentifiers.framework; sourceTree = SDKROOT; }; 538E396C27F4765000FA63D5 /* FileProviderExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderExtension.swift; sourceTree = ""; }; @@ -230,6 +240,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 5388E8A42BCD0E0B00557E8A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 538E396427F4765000FA63D5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -321,6 +338,14 @@ path = Extensions; sourceTree = ""; }; + 5388E8A82BCD0E0B00557E8A /* FileProviderExtTests */ = { + isa = PBXGroup; + children = ( + 5388E8A92BCD0E0B00557E8A /* FileProviderExtTests.swift */, + ); + path = FileProviderExtTests; + sourceTree = ""; + }; 538E396827F4765000FA63D5 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -391,6 +416,7 @@ C2B573B31B1CD91E00303B36 /* desktopclient */, C2B573D81B1CD9CE00303B36 /* FinderSyncExt */, 538E396B27F4765000FA63D5 /* FileProviderExt */, + 5388E8A82BCD0E0B00557E8A /* FileProviderExtTests */, 53B9797F2B84C81F002DA742 /* FileProviderUIExt */, 53903D0D2956164F00D0B308 /* NCDesktopClientSocketKit */, 538E396827F4765000FA63D5 /* Frameworks */, @@ -406,6 +432,7 @@ 538E396727F4765000FA63D5 /* FileProviderExt.appex */, 53903D0C2956164F00D0B308 /* NCDesktopClientSocketKit.framework */, 53B9797E2B84C81F002DA742 /* FileProviderUIExt.appex */, + 5388E8A72BCD0E0B00557E8A /* FileProviderExtTests.xctest */, ); name = Products; sourceTree = ""; @@ -470,6 +497,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 5388E8A62BCD0E0B00557E8A /* FileProviderExtTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5388E8AD2BCD0E0B00557E8A /* Build configuration list for PBXNativeTarget "FileProviderExtTests" */; + buildPhases = ( + 5388E8A32BCD0E0B00557E8A /* Sources */, + 5388E8A42BCD0E0B00557E8A /* Frameworks */, + 5388E8A52BCD0E0B00557E8A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5388E8AC2BCD0E0B00557E8A /* PBXTargetDependency */, + ); + name = FileProviderExtTests; + productName = FileProviderExtTests; + productReference = 5388E8A72BCD0E0B00557E8A /* FileProviderExtTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 538E396627F4765000FA63D5 /* FileProviderExt */ = { isa = PBXNativeTarget; buildConfigurationList = 538E397927F4765000FA63D5 /* Build configuration list for PBXNativeTarget "FileProviderExt" */; @@ -586,9 +631,13 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 1520; + LastSwiftUpdateCheck = 1530; LastUpgradeCheck = 1240; TargetAttributes = { + 5388E8A62BCD0E0B00557E8A = { + CreatedOnToolsVersion = 15.3; + TestTargetID = C2B573B01B1CD91E00303B36; + }; 538E396627F4765000FA63D5 = { CreatedOnToolsVersion = 13.3; }; @@ -641,11 +690,19 @@ 538E396627F4765000FA63D5 /* FileProviderExt */, 53B9797D2B84C81F002DA742 /* FileProviderUIExt */, 53903D0B2956164F00D0B308 /* NCDesktopClientSocketKit */, + 5388E8A62BCD0E0B00557E8A /* FileProviderExtTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 5388E8A52BCD0E0B00557E8A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 538E396527F4765000FA63D5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -709,6 +766,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 5388E8A32BCD0E0B00557E8A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5388E8AA2BCD0E0B00557E8A /* FileProviderExtTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 538E396327F4765000FA63D5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -786,6 +851,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 5388E8AC2BCD0E0B00557E8A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C2B573B01B1CD91E00303B36 /* desktopclient */; + targetProxy = 5388E8AB2BCD0E0B00557E8A /* PBXContainerItemProxy */; + }; 538E397527F4765000FA63D5 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 538E396627F4765000FA63D5 /* FileProviderExt */; @@ -818,6 +888,97 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 5388E8AE2BCD0E0B00557E8A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = NKUJUXUJ3B; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 14.2; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.nextcloud.FileProviderExtTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/desktopclient.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/desktopclient"; + }; + name = Debug; + }; + 5388E8AF2BCD0E0B00557E8A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = NKUJUXUJ3B; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 14.2; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.nextcloud.FileProviderExtTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/desktopclient.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/desktopclient"; + }; + name = Release; + }; 538E397727F4765000FA63D5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1466,6 +1627,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 5388E8AD2BCD0E0B00557E8A /* Build configuration list for PBXNativeTarget "FileProviderExtTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5388E8AE2BCD0E0B00557E8A /* Debug */, + 5388E8AF2BCD0E0B00557E8A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 538E397927F4765000FA63D5 /* Build configuration list for PBXNativeTarget "FileProviderExt" */ = { isa = XCConfigurationList; buildConfigurations = ( -- 2.30.2