Completely convert project to Tuist.

This commit is contained in:
Matyáš Kříž 2022-03-10 19:34:28 +01:00
parent cbb5f5d416
commit 835c61246a
125 changed files with 898 additions and 4152 deletions

View File

@ -34,12 +34,12 @@ platform :mac do
def upload_release release_type
# Building Cuckoo Generator
Dir.chdir '../Generator' do
sh '../build_generator', '--arch', 'arm64', '--arch', 'x86_64'
sh '../build_generator'
end
# Settings
binary_name = 'cuckoo_generator'
cuckoo_gen_path = Dir.glob("../Generator/.build/**/Release/#{binary_name}").first
cuckoo_gen_path = "../Generator/bin/#{binary_name}"
# GitHub username
username_var_name = 'GITHUB_USERNAME'

26
.gitignore vendored
View File

@ -1,5 +1,4 @@
# Xcode
#
.build/
build/
*.pbxuser
@ -19,19 +18,11 @@ DerivedData
*.xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
Pods
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
.DS_Store
default.profraw
Tests/**/Generated/*.swift
@ -40,9 +31,20 @@ Generator/*.app
# AppCode
.idea/
cuckoo_generator
Generator/CuckooGenerator.xcodeproj
.fastlane
Cuckoo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Generator/CuckooGenerator.xcodeproj
Cuckoo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Cuckoo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Cuckoo.xcworkspace
Cuckoo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Tuist/Dependencies/graph.json
Tuist/Dependencies/Carthage
Tuist/Dependencies/SwiftPackageManager
Tuist/Dependencies/Cocoapods
Generator/Generator.xcodeproj
Generator/GeneratedMocks.swift

104
.package.resolved Normal file
View File

@ -0,0 +1,104 @@
{
"pins" : [
{
"identity" : "commandant",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Carthage/Commandant.git",
"state" : {
"revision" : "07cad52573bad19d95844035bf0b25acddf6b0f6",
"version" : "0.15.0"
}
},
{
"identity" : "filekit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nvzqz/FileKit.git",
"state" : {
"branch" : "develop",
"revision" : "6937ec38b0c383b0505caeea6603e62086bf5431"
}
},
{
"identity" : "nimble",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Quick/Nimble.git",
"state" : {
"revision" : "e9d769113660769a4d9dd3afb855562c0b7ae7b0",
"version" : "7.3.4"
}
},
{
"identity" : "pathkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/PathKit.git",
"state" : {
"revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
"version" : "1.0.1"
}
},
{
"identity" : "quick",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Quick/Quick.git",
"state" : {
"revision" : "f2b5a06440ea87eba1a167cab37bf6496646c52e",
"version" : "1.3.4"
}
},
{
"identity" : "result",
"kind" : "remoteSourceControl",
"location" : "https://github.com/antitypical/Result.git",
"state" : {
"revision" : "2ca499ba456795616fbc471561ff1d963e6ae160",
"version" : "4.1.0"
}
},
{
"identity" : "sourcekitten",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/SourceKitten.git",
"state" : {
"revision" : "79ca340f609adee48defa966e6a3dd0e0acbeb08",
"version" : "0.21.3"
}
},
{
"identity" : "spectre",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/Spectre.git",
"state" : {
"revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version" : "0.10.1"
}
},
{
"identity" : "stencil",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/Stencil.git",
"state" : {
"revision" : "ccd9402682f4c07dac9561befd207c8156e80e20",
"version" : "0.14.2"
}
},
{
"identity" : "swxmlhash",
"kind" : "remoteSourceControl",
"location" : "https://github.com/drmohundro/SWXMLHash.git",
"state" : {
"revision" : "f43166a8e18fdd0857f29e303b1bb79a5428bca0",
"version" : "4.9.0"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams.git",
"state" : {
"revision" : "b08dba4bcea978bf1ad37703a384097d3efce5af",
"version" : "1.0.2"
}
}
],
"version" : 2
}

1
.tuist-version Normal file
View File

@ -0,0 +1 @@
3.11.0

File diff suppressed because it is too large Load Diff

View File

@ -26,8 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92C74015545203C1F4395DD4"
BuildableName = "Cuckoo_iOSTests.xctest"
BlueprintName = "Cuckoo-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92C74015545203C1F4395DD4"
BuildableName = "Cuckoo_iOSTests.xctest"
BlueprintName = "Cuckoo-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92C74015545203C1F4395DD4"
BuildableName = "Cuckoo_iOSTests.xctest"
BlueprintName = "Cuckoo-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92C74015545203C1F4395DD4"
BuildableName = "Cuckoo_iOSTests.xctest"
BlueprintName = "Cuckoo-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -26,8 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBDB2DD4E7BE487EEB257CC8"
BuildableName = "Cuckoo_macOSTests.xctest"
BlueprintName = "Cuckoo-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBDB2DD4E7BE487EEB257CC8"
BuildableName = "Cuckoo_macOSTests.xctest"
BlueprintName = "Cuckoo-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBDB2DD4E7BE487EEB257CC8"
BuildableName = "Cuckoo_macOSTests.xctest"
BlueprintName = "Cuckoo-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBDB2DD4E7BE487EEB257CC8"
BuildableName = "Cuckoo_macOSTests.xctest"
BlueprintName = "Cuckoo-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -26,8 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6AD4A9670FA783A1EC213000"
BuildableName = "Cuckoo_tvOSTests.xctest"
BlueprintName = "Cuckoo-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6AD4A9670FA783A1EC213000"
BuildableName = "Cuckoo_tvOSTests.xctest"
BlueprintName = "Cuckoo-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6AD4A9670FA783A1EC213000"
BuildableName = "Cuckoo_tvOSTests.xctest"
BlueprintName = "Cuckoo-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6AD4A9670FA783A1EC213000"
BuildableName = "Cuckoo_tvOSTests.xctest"
BlueprintName = "Cuckoo-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "362F98B48959E1D7172FD65B"
BuildableName = "Cuckoo_OCMock_iOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "362F98B48959E1D7172FD65B"
BuildableName = "Cuckoo_OCMock_iOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "362F98B48959E1D7172FD65B"
BuildableName = "Cuckoo_OCMock_iOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "362F98B48959E1D7172FD65B"
BuildableName = "Cuckoo_OCMock_iOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-iOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1D9ED40B0DCFD564F7B741F"
BuildableName = "Cuckoo_OCMock_macOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1D9ED40B0DCFD564F7B741F"
BuildableName = "Cuckoo_OCMock_macOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1D9ED40B0DCFD564F7B741F"
BuildableName = "Cuckoo_OCMock_macOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D1D9ED40B0DCFD564F7B741F"
BuildableName = "Cuckoo_OCMock_macOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-macOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "05F906FDC36D67A5E1CB8CF6"
BuildableName = "Cuckoo_OCMock_tvOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "05F906FDC36D67A5E1CB8CF6"
BuildableName = "Cuckoo_OCMock_tvOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "05F906FDC36D67A5E1CB8CF6"
BuildableName = "Cuckoo_OCMock_tvOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
</EnvironmentVariables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "05F906FDC36D67A5E1CB8CF6"
BuildableName = "Cuckoo_OCMock_tvOSTests.xctest"
BlueprintName = "Cuckoo_OCMock-tvOSTests"
ReferencedContainer = "container:Cuckoo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@ -12,17 +12,11 @@
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.8.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Brightify. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
<string>Copyright ©. All rights reserved.</string>
</dict>
</plist>

View File

@ -1,72 +0,0 @@
{
"autoPin": true,
"pins": [
{
"package": "Clang_C",
"reason": null,
"repositoryURL": "https://github.com/norio-nomura/Clang_C.git",
"version": "1.0.2"
},
{
"package": "Commandant",
"reason": null,
"repositoryURL": "https://github.com/Carthage/Commandant.git",
"version": "0.12.0"
},
{
"package": "FileKit",
"reason": null,
"repositoryURL": "https://github.com/TadeasKriz/FileKit.git",
"version": "4.0.2"
},
{
"package": "PathKit",
"reason": null,
"repositoryURL": "https://github.com/kylef/PathKit.git",
"version": "0.8.0"
},
{
"package": "Result",
"reason": null,
"repositoryURL": "https://github.com/antitypical/Result.git",
"version": "3.2.1"
},
{
"package": "SWXMLHash",
"reason": null,
"repositoryURL": "https://github.com/drmohundro/SWXMLHash.git",
"version": "3.0.4"
},
{
"package": "SourceKit",
"reason": null,
"repositoryURL": "https://github.com/norio-nomura/SourceKit.git",
"version": "1.0.1"
},
{
"package": "SourceKitten",
"reason": null,
"repositoryURL": "https://github.com/jpsim/SourceKitten.git",
"version": "0.17.2"
},
{
"package": "Spectre",
"reason": null,
"repositoryURL": "https://github.com/kylef/Spectre.git",
"version": "0.7.2"
},
{
"package": "Stencil",
"reason": null,
"repositoryURL": "https://github.com/kylef/Stencil.git",
"version": "0.8.0"
},
{
"package": "Yams",
"reason": null,
"repositoryURL": "https://github.com/jpsim/Yams.git",
"version": "0.3.2"
}
],
"version": 1
}

View File

@ -1,106 +0,0 @@
{
"object": {
"pins": [
{
"package": "Commandant",
"repositoryURL": "https://github.com/Carthage/Commandant.git",
"state": {
"branch": null,
"revision": "07cad52573bad19d95844035bf0b25acddf6b0f6",
"version": "0.15.0"
}
},
{
"package": "FileKit",
"repositoryURL": "https://github.com/nvzqz/FileKit.git",
"state": {
"branch": "develop",
"revision": "48b5ddb287f131a5c628badc819b880453f94449",
"version": null
}
},
{
"package": "Nimble",
"repositoryURL": "https://github.com/Quick/Nimble.git",
"state": {
"branch": null,
"revision": "e9d769113660769a4d9dd3afb855562c0b7ae7b0",
"version": "7.3.4"
}
},
{
"package": "PathKit",
"repositoryURL": "https://github.com/kylef/PathKit.git",
"state": {
"branch": null,
"revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
"version": "1.0.1"
}
},
{
"package": "Quick",
"repositoryURL": "https://github.com/Quick/Quick.git",
"state": {
"branch": null,
"revision": "f2b5a06440ea87eba1a167cab37bf6496646c52e",
"version": "1.3.4"
}
},
{
"package": "Result",
"repositoryURL": "https://github.com/antitypical/Result.git",
"state": {
"branch": null,
"revision": "2ca499ba456795616fbc471561ff1d963e6ae160",
"version": "4.1.0"
}
},
{
"package": "SourceKitten",
"repositoryURL": "https://github.com/jpsim/SourceKitten.git",
"state": {
"branch": null,
"revision": "79ca340f609adee48defa966e6a3dd0e0acbeb08",
"version": "0.21.3"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version": "0.10.1"
}
},
{
"package": "Stencil",
"repositoryURL": "https://github.com/kylef/Stencil.git",
"state": {
"branch": null,
"revision": "ccd9402682f4c07dac9561befd207c8156e80e20",
"version": "0.14.2"
}
},
{
"package": "SWXMLHash",
"repositoryURL": "https://github.com/drmohundro/SWXMLHash.git",
"state": {
"branch": null,
"revision": "f43166a8e18fdd0857f29e303b1bb79a5428bca0",
"version": "4.9.0"
}
},
{
"package": "Yams",
"repositoryURL": "https://github.com/jpsim/Yams.git",
"state": {
"branch": null,
"revision": "b08dba4bcea978bf1ad37703a384097d3efce5af",
"version": "1.0.2"
}
}
]
},
"version": 1
}

View File

@ -1,24 +0,0 @@
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "CuckooGenerator",
products: [
.library(name: "CuckooGeneratorFramework", targets:["CuckooGeneratorFramework", "cuckoo_generator"]),
.executable(name: "cuckoo_generator", targets: ["cuckoo_generator"])
],
dependencies: [
.package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMinor(from: "0.21.2")),
.package(url: "https://github.com/nvzqz/FileKit.git", .branch("develop")),
.package(url: "https://github.com/kylef/Stencil.git", from: "0.14.2"),
.package(url: "https://github.com/Carthage/Commandant.git", from: "0.12.0")
],
targets: [
.target(name: "CuckooGeneratorFramework", dependencies: [
"FileKit", "SourceKittenFramework", "Stencil", "Commandant"], exclude: ["Tests"]),
.target(name: "cuckoo_generator", dependencies: [
.target(name: "CuckooGeneratorFramework")], exclude: ["Tests"]),
]
)

56
Generator/Project.swift Normal file
View File

@ -0,0 +1,56 @@
import ProjectDescription
import ProjectDescriptionHelpers
// MARK: project definition
let project = Project(
name: "Generator",
options: .options(automaticSchemesOptions: .disabled, disableSynthesizedResourceAccessors: true),
packages: [
.package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMinor(from: "0.21.2")),
.package(url: "https://github.com/nvzqz/FileKit.git", .branch("develop")),
.package(url: "https://github.com/kylef/Stencil.git", .exact("0.14.2")),
.package(url: "https://github.com/Carthage/Commandant.git", .exact("0.15.0")),
],
targets: [
Target(
name: "CuckooGenerator",
platform: .macOS,
product: .commandLineTool,
productName: "cuckoo_generator",
bundleId: "CuckooGenerator",
deploymentTarget: DeploymentTarget.macOS(targetVersion: "10.13"),
sources: "Source/**",
dependencies: ["FileKit", "SourceKittenFramework", "Stencil", "Commandant"].map(TargetDependency.package(product:))
),
],
schemes: [
Scheme(
name: "Generator",
buildAction: BuildAction.buildAction(
targets: ["CuckooGenerator"],
postActions: [
ExecutionAction(
title: "Copy executable",
scriptText: #"\cp "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" "$PROJECT_DIR/bin/cuckoo_generator""#,
target: "CuckooGenerator"
)
],
runPostActionsOnFailure: false
),
runAction: RunAction.runAction(
executable: "CuckooGenerator",
arguments: Arguments(
launchArguments: [
// Any changes here should be reflected in `../Project.swift` as well.
LaunchArgument(name: "generate", isEnabled: true),
LaunchArgument(name: "--testable Cuckoo", isEnabled: true),
LaunchArgument(name: "--exclude ExcludedTestClass,ExcludedProtocol", isEnabled: true),
LaunchArgument(name: #"--output "$PROJECT_DIR"/GeneratedMocks.swift"#, isEnabled: true),
// This is the input file(s) glob.
LaunchArgument(name: #"--glob "$PROJECT_DIR"/../Tests/Swift/Source/*.swift"#, isEnabled: true),
]
)
)
),
]
)

View File

@ -1,11 +1,3 @@
//
// CuckooGeneratorError.swift
// CuckooGenerator
//
// Created by Tadeas Kriz on 13/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
import FileKit

View File

@ -1,17 +1,8 @@
//
// GenerateMocksCommand.swift
// CuckooGenerator
//
// Created by Tadeas Kriz on 12/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
import Commandant
import Result
import SourceKittenFramework
import FileKit
import CuckooGeneratorFramework
import Foundation
private func curry<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, R>
(_ f: @escaping (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> R)
@ -179,18 +170,19 @@ public struct GenerateMocksCommand: CommandProtocol {
let globEnabled: Bool
let regex: String
public init(output: String,
testableFrameworks: String,
exclude: String,
noHeader: Bool,
noTimestamp: Bool,
noInheritance: Bool,
filePrefix: String,
noClassMocking: Bool,
debugMode: Bool,
globEnabled: Bool,
regex: String,
files: [String]
public init(
output: String,
testableFrameworks: String,
exclude: String,
noHeader: Bool,
noTimestamp: Bool,
noInheritance: Bool,
filePrefix: String,
noClassMocking: Bool,
debugMode: Bool,
globEnabled: Bool,
regex: String,
files: [String]
) {
self.output = output
self.testableFrameworks = testableFrameworks.components(separatedBy: ",").filter { !$0.isEmpty }

View File

@ -1,12 +1,6 @@
//
// Created by Eric Firestone on 3/22/16.
// Copyright © 2016 Square, Inc. All rights reserved.
// Released under the Apache v2 License.
//
// Adapted from https://gist.github.com/blakemerryman/76312e1cbf8aec248167
import Foundation
// Adapted from https://gist.github.com/blakemerryman/76312e1cbf8aec248167
/**
Finds files on the file system using pattern matching.
*/

View File

@ -1,11 +1,3 @@
//
// VersionCommand.swift
// CuckooGenerator
//
// Created by Tadeas Kriz on 17/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
import Commandant
import Result

View File

@ -1,12 +1,3 @@
//#!/usr/bin/swift -F Carthage/Build/Mac
//
// main.swift
// SwiftMockGenerator
//
// Created by Tadeas Kriz on 12/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
import Commandant

View File

@ -1,36 +0,0 @@
//
// CodeBuilder.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 06.07.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public class CodeBuilder {
fileprivate static let Tab = " "
public fileprivate(set) var code = ""
fileprivate var nesting = 0
public func clear() {
code = ""
}
public func nest(_ closure: () -> ()) {
nesting += 1
closure()
nesting -= 1
}
public func nest(_ line: String) {
nest { self += line }
}
}
public func +=(left: CodeBuilder, right: String) {
(0..<left.nesting).forEach { _ in left.code += CodeBuilder.Tab }
left.code += right
left.code += "\n"
}

View File

@ -1,17 +0,0 @@
//
// CuckooGeneratorFramework.h
// CuckooGeneratorFramework
//
// Created by Tadeas Kriz on 13/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for CuckooGeneratorFramework.
FOUNDATION_EXPORT double CuckooGeneratorFrameworkVersionNumber;
//! Project version string for CuckooGeneratorFramework.
FOUNDATION_EXPORT const unsigned char CuckooGeneratorFrameworkVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <CuckooGeneratorFramework/PublicHeader.h>

View File

@ -1,11 +1,3 @@
//
// FileHeaderHandler.swift
// CuckooGenerator
//
// Created by Tadeas Kriz on 12/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
import FileKit

View File

@ -1,11 +1,3 @@
//
// Generator.swift
// CuckooGenerator
//
// Created by Tadeas Kriz on 13/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
import Stencil
@ -23,15 +15,12 @@ public struct Generator {
]
private let declarations: [Token]
private let code = CodeBuilder()
public init(file: FileRepresentation) {
declarations = file.declarations
}
public func generate(debug: Bool = false) throws -> String {
code.clear()
let ext = Extension()
ext.registerFilter("genericSafe") { (value: Any?) in
guard let string = value as? String else { return value }

View File

@ -1,10 +1,3 @@
//
// Reference.swift
// CuckooGeneratorFramework
//
// Created by Tyler Thompson on 9/18/20.
//
import Foundation
@dynamicMemberLookup

View File

@ -1,11 +1,3 @@
//
// StderrPrint.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 18.12.16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
public private(set) var stderrUsed = false

View File

@ -1,10 +1,3 @@
//
// MockTemplate.swift
// CuckooGeneratorFramework
//
// Created by Tadeas Kriz on 11/14/17.
//
import Foundation
extension Templates {

View File

@ -1,10 +1,3 @@
//
// NopImplStubTemplate.swift
// CuckooGeneratorFramework
//
// Created by Tadeas Kriz on 11/14/17.
//
extension Templates {
static let noImplStub = """
{% for attribute in container.attributes %}

View File

@ -1,10 +1,3 @@
//
// StubbingProxyTemplate.swift
// CuckooGeneratorFramework
//
// Created by Tadeas Kriz on 11/14/17.
//
import Foundation
extension Templates {

View File

@ -1,10 +1,3 @@
//
// Templates.swift
// CuckooGeneratorFramework
//
// Created by Tadeas Kriz on 11/14/17.
//
import Foundation
struct Templates { }

View File

@ -1,10 +1,3 @@
//
// TypeErasureTemplate.swift
// CuckooGeneratorFramework
//
// Created by Matyáš Kříž on 26/11/2018.
//
import Foundation
extension Templates {

View File

@ -1,10 +1,3 @@
//
// VerificationProxyTemplate.swift
// CuckooGeneratorFramework
//
// Created by Tadeas Kriz on 11/14/17.
//
import Foundation
extension Templates {

View File

@ -1,11 +1,3 @@
//
// Accessibility.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public enum Accessibility: String {
case Open = "source.lang.swift.accessibility.open"
case Public = "source.lang.swift.accessibility.public"

View File

@ -1,10 +1,3 @@
//
// ChildToken.swift
// CuckooGeneratorFramework
//
// Created by Tyler Thompson on 9/18/20.
//
import Foundation
public protocol ChildToken: Token {

View File

@ -1,11 +1,3 @@
//
// ClassDeclaration.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct ClassDeclaration: ContainerToken, HasAccessibility {
public let implementation: Bool = true
public var name: String

View File

@ -1,11 +1,3 @@
//
// ClassMethod.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct ClassMethod: Method {
public var name: String
public var accessibility: Accessibility

View File

@ -1,11 +1,3 @@
//
// ContainerToken.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public protocol ContainerToken: ParentToken, ChildToken {
var initializers: [Initializer] { get }
var implementation: Bool { get }

View File

@ -1,11 +1,3 @@
//
// ExtensionDeclaration.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 17.06.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct ExtensionDeclaration: ParentToken {
// TODO Implement support for extensions
public let name: String

View File

@ -1,11 +1,3 @@
//
// FileRepresentation.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
import SourceKittenFramework
public struct FileRepresentation {

View File

@ -1,10 +1,3 @@
//
// GenericParameter.swift
// CuckooGeneratorFramework
//
// Created by Matyáš Kříž on 19/11/2018.
//
import Foundation
public struct GenericParameter: Token {

View File

@ -1,10 +1,3 @@
//
// HasAccessibility.swift
// CuckooGenerator
//
// Created by Matyáš Kříž on 11/03/2019.
//
import Foundation
public protocol HasAccessibility {

View File

@ -1,10 +1,3 @@
//
// HasAccessibility.swift
// CuckooGenerator
//
// Created by Roland Kákonyi on 03/05/2022.
//
import Foundation
public protocol HasAttributes {
@ -23,4 +16,4 @@ extension HasAttributes {
var unavailablePlatformsCheck: String {
return hasUnavailablePlatforms ? "#if !os(\(unavailablePlatforms.joined(separator: ") && !os(")))" : ""
}
}
}

View File

@ -1,11 +1,3 @@
//
// Import.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 17.06.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct Import: Token {
public enum Importee: CustomStringConvertible {
case library(name: String)

View File

@ -1,11 +1,3 @@
//
// InheritanceDeclaration.swift
// CuckooGenerator
//
// Created by Arjan Duijzer on 22/02/2017.
// Copyright (c) 2017 Brightify. All rights reserved.
//
public struct InheritanceDeclaration: Token {
public static let empty = InheritanceDeclaration(name: Tokenizer.nameNotSet)
public let name: String
@ -14,4 +6,4 @@ public struct InheritanceDeclaration: Token {
guard let other = other as? InheritanceDeclaration else { return false }
return self.name == other.name
}
}
}

View File

@ -1,11 +1,3 @@
//
// Initializer.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct Initializer: Method, HasAccessibility {
public var name: String
public var accessibility: Accessibility

View File

@ -1,11 +1,3 @@
//
// InstanceVariable.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct InstanceVariable: Token, HasAccessibility, HasAttributes {
public var name: String
public var type: WrappableType

View File

@ -1,11 +1,3 @@
//
// Key.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public enum Key: String {
case Substructure = "key.substructure"
case Kind = "key.kind"

View File

@ -1,11 +1,3 @@
//
// Kinds.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public enum Kinds: String {
case ProtocolDeclaration = "source.lang.swift.decl.protocol"
case InstanceMethod = "source.lang.swift.decl.function.method.instance"

View File

@ -1,11 +1,3 @@
//
// Method.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
public protocol Method: Token, HasAccessibility, HasAttributes {

View File

@ -1,11 +1,3 @@
//
// MethodParameter.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct MethodParameter: Token, Equatable {
public var label: String?
public var name: String

View File

@ -1,10 +1,3 @@
//
// ParentToken.swift
// CuckooGeneratorFramework
//
// Created by Tyler Thompson on 9/18/20.
//
import Foundation
public protocol ParentToken: Token, HasAccessibility, HasAttributes {

View File

@ -1,11 +1,3 @@
//
// ProtocolDeclaration.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct ProtocolDeclaration: ContainerToken, HasAccessibility {
public let implementation: Bool = false
public var name: String

View File

@ -1,11 +1,3 @@
//
// ProtocolMethod.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public struct ProtocolMethod: Method {
public var name: String
public var accessibility: Accessibility

View File

@ -1,10 +1,3 @@
//
// ReturnSignature.swift
// CuckooGeneratorFramework
//
// Created by Matyáš Kříž on 25/03/2019.
//
import Foundation
public struct ReturnSignature {

View File

@ -1,10 +1,3 @@
//
// StructDeclaration.swift
// CuckooGeneratorFramework
//
// Created by Tyler Thompson on 9/18/20.
//
import Foundation
public struct StructDeclaration: ParentToken {

View File

@ -1,10 +1,3 @@
//
// ThrowType.swift
// CuckooGeneratorFramework
//
// Created by Matyáš Kříž on 14/05/2019.
//
public enum ThrowType: CustomStringConvertible {
case throwing
case rethrowing

View File

@ -1,11 +1,3 @@
//
// Token.swift
// CuckooGenerator
//
// Created by Filip Dolnik on 30.05.16.
// Copyright © 2016 Brightify. All rights reserved.
//
public protocol Token {
func isEqual(to other: Token) -> Bool

View File

@ -1,10 +1,3 @@
//
// WrappableType.swift
// CuckooGeneratorFramework
//
// Created by Matyáš Kříž on 13/03/2019.
//
public enum WrappableType {
indirect case optional(WrappableType)
indirect case implicitlyUnwrappedOptional(WrappableType)

View File

@ -1,10 +1,3 @@
//
// TypeGuesser.swift
// CuckooGeneratorFramework
//
// Created by Matyáš Kříž on 31/05/2019.
//
import Foundation
struct TypeGuesser {

View File

@ -1,11 +1,3 @@
//
// String+Utility.swift
// CuckooGenerator
//
// Created by Tadeas Kriz on 12/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
import SourceKittenFramework

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>BundleIsVersionChecked</key>
<false/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>ChildBundles</key>
<array>
<dict>
<key>BundleOverwriteAction</key>
<string></string>
<key>RootRelativeBundlePath</key>
<string>/usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/FileKit.framework</string>
</dict>
<dict>
<key>BundleOverwriteAction</key>
<string></string>
<key>RootRelativeBundlePath</key>
<string>/usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/Result.framework</string>
</dict>
<dict>
<key>BundleOverwriteAction</key>
<string></string>
<key>RootRelativeBundlePath</key>
<string>/usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/Commandant.framework</string>
</dict>
<dict>
<key>BundleOverwriteAction</key>
<string></string>
<key>RootRelativeBundlePath</key>
<string>/usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/SWXMLHash.framework</string>
</dict>
<dict>
<key>BundleOverwriteAction</key>
<string></string>
<key>RootRelativeBundlePath</key>
<string>/usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework</string>
</dict>
</array>
<key>RootRelativeBundlePath</key>
<string>/usr/local/Frameworks/CuckooGeneratorFramework.framework</string>
</dict>
</array>
</plist>

View File

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.8.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Brightify. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -1,2 +0,0 @@
source 'https://rubygems.org'
gem 'aruba', '~> 0.14.1'

View File

@ -1,44 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
aruba (0.14.1)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
builder (3.2.2)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
contracts (0.14.0)
cucumber (2.4.0)
builder (>= 2.1.2)
cucumber-core (~> 1.5.0)
cucumber-wire (~> 0.0.1)
diff-lcs (>= 1.1.3)
gherkin (~> 4.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (1.5.0)
gherkin (~> 4.0)
cucumber-wire (0.0.1)
diff-lcs (1.2.5)
ffi (1.9.25)
gherkin (4.0.0)
multi_json (1.12.1)
multi_test (0.1.2)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
thor (0.19.1)
PLATFORMS
ruby
DEPENDENCIES
aruba (~> 0.14.1)
BUNDLED WITH
1.12.5

View File

@ -1,7 +0,0 @@
/* Multi
line
comment */
@objc
public class ClassWithAttributes {
}

View File

@ -1,14 +0,0 @@
//
// ClassWithInit.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
class ClassWithInit {
init(parameter: String) {
}
}

View File

@ -1,38 +0,0 @@
//
// ClassWithOptionals.swift
// Cuckoo
//
// Created by Filip Dolnik on 18.12.16.
// Copyright © 2016 Brightify. All rights reserved.
//
class ClassWithOptionals {
var value: Int? = 0
var uValue: Int! = 0
var array: [Int?] = []
var closure: (Int?) -> Void = { _ in }
var uClosure: (Int!) -> Void = { _ in }
func returnValue() -> Int? {
return value
}
func returnUValue() -> Int! {
return uValue
}
func returnArray() -> [Int?] {
return array
}
func parameter(parameter: Int?) {
}
func uParameter(parameter: Int!) {
}
}

View File

@ -1,12 +0,0 @@
//
// EmptyClass.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Foundation
class EmptyClass {
}

View File

@ -1,43 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/ClassWithAttributes.swift
/* Multi
line
comment */
import Cuckoo
public class MockClassWithAttributes: ClassWithAttributes, Cuckoo.Mock {
public typealias MocksType = ClassWithAttributes
public typealias Stubbing = __StubbingProxy_ClassWithAttributes
public typealias Verification = __VerificationProxy_ClassWithAttributes
public let cuckoo_manager = Cuckoo.MockManager()
private var observed: ClassWithAttributes?
public func spy(on victim: ClassWithAttributes) -> Self {
observed = victim
return self
}
public struct __StubbingProxy_ClassWithAttributes: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
public init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
}
public struct __VerificationProxy_ClassWithAttributes: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
public init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
}
}
public class ClassWithAttributesStub: ClassWithAttributes {
}

View File

@ -1,47 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/ClassWithInit.swift
//
// ClassWithInit.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
class MockClassWithInit: ClassWithInit, Cuckoo.Mock {
typealias MocksType = ClassWithInit
typealias Stubbing = __StubbingProxy_ClassWithInit
typealias Verification = __VerificationProxy_ClassWithInit
let cuckoo_manager = Cuckoo.MockManager()
private var observed: ClassWithInit?
func spy(on victim: ClassWithInit) -> Self {
observed = victim
return self
}
struct __StubbingProxy_ClassWithInit: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
}
struct __VerificationProxy_ClassWithInit: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
}
}
class ClassWithInitStub: ClassWithInit {
}

View File

@ -1,261 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/ClassWithOptionals.swift
//
// ClassWithOptionals.swift
// Cuckoo
//
// Created by Filip Dolnik on 18.12.16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
class MockClassWithOptionals: ClassWithOptionals, Cuckoo.Mock {
typealias MocksType = ClassWithOptionals
typealias Stubbing = __StubbingProxy_ClassWithOptionals
typealias Verification = __VerificationProxy_ClassWithOptionals
let cuckoo_manager = Cuckoo.MockManager()
private var observed: ClassWithOptionals?
func spy(on victim: ClassWithOptionals) -> Self {
observed = victim
return self
}
override var value: Int? {
get {
return cuckoo_manager.getter("value", original: observed.map { o in return { () -> Int? in o.value } })
}
set {
cuckoo_manager.setter("value", value: newValue, original: observed != nil ? { self.observed?.value = $0 } : nil)
}
}
override var uValue: Int! {
get {
return cuckoo_manager.getter("uValue", original: observed.map { o in return { () -> Int! in o.uValue } })
}
set {
cuckoo_manager.setter("uValue", value: newValue, original: observed != nil ? { self.observed?.uValue = $0 } : nil)
}
}
override var array: [Int?] {
get {
return cuckoo_manager.getter("array", original: observed.map { o in return { () -> [Int?] in o.array } })
}
set {
cuckoo_manager.setter("array", value: newValue, original: observed != nil ? { self.observed?.array = $0 } : nil)
}
}
override var closure: (Int?) -> Void {
get {
return cuckoo_manager.getter("closure", original: observed.map { o in return { () -> (Int?) -> Void in o.closure } })
}
set {
cuckoo_manager.setter("closure", value: newValue, original: observed != nil ? { self.observed?.closure = $0 } : nil)
}
}
override var uClosure: (Int!) -> Void {
get {
return cuckoo_manager.getter("uClosure", original: observed.map { o in return { () -> (Int!) -> Void in o.uClosure } })
}
set {
cuckoo_manager.setter("uClosure", value: newValue, original: observed != nil ? { self.observed?.uClosure = $0 } : nil)
}
}
override func returnValue() -> Int? {
return cuckoo_manager.call("returnValue() -> Int?", parameters: (), original: observed.map { o in return { () -> Int? in o.returnValue() } })
}
override func returnUValue() -> Int! {
return cuckoo_manager.call("returnUValue() -> Int!", parameters: (), original: observed.map { o in return { () -> Int! in o.returnUValue() } })
}
override func returnArray() -> [Int?] {
return cuckoo_manager.call("returnArray() -> [Int?]", parameters: (), original: observed.map { o in return { () -> [Int?] in o.returnArray() } })
}
override func parameter(parameter: Int?) {
return cuckoo_manager.call("parameter(parameter: Int?)", parameters: (parameter), original: observed.map { o in return { (parameter: Int?) in o.parameter(parameter: parameter) } })
}
override func uParameter(parameter: Int!) {
return cuckoo_manager.call("uParameter(parameter: Int!)", parameters: (parameter), original: observed.map { o in return { (parameter: Int!) in o.uParameter(parameter: parameter) } })
}
struct __StubbingProxy_ClassWithOptionals: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
var value: Cuckoo.ToBeStubbedProperty<Int?> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "value")
}
var uValue: Cuckoo.ToBeStubbedProperty<Int?> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "uValue")
}
var array: Cuckoo.ToBeStubbedProperty<[Int?]> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "array")
}
var closure: Cuckoo.ToBeStubbedProperty<(Int?) -> Void> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "closure")
}
var uClosure: Cuckoo.ToBeStubbedProperty<(Int?) -> Void> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "uClosure")
}
func returnValue() -> Cuckoo.StubFunction<(), Int?> {
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("returnValue() -> Int?", parameterMatchers: []))
}
func returnUValue() -> Cuckoo.StubFunction<(), Int?> {
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("returnUValue() -> Int!", parameterMatchers: []))
}
func returnArray() -> Cuckoo.StubFunction<(), [Int?]> {
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("returnArray() -> [Int?]", parameterMatchers: []))
}
func parameter<M1: Cuckoo.Matchable>(parameter: M1) -> Cuckoo.StubNoReturnFunction<(Int?)> where M1.MatchedType == Int? {
let matchers: [Cuckoo.ParameterMatcher<(Int?)>] = [wrap(matchable: parameter) { $0 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("parameter(parameter: Int?)", parameterMatchers: matchers))
}
func uParameter<M1: Cuckoo.Matchable>(parameter: M1) -> Cuckoo.StubNoReturnFunction<(Int?)> where M1.MatchedType == Int? {
let matchers: [Cuckoo.ParameterMatcher<(Int?)>] = [wrap(matchable: parameter) { $0 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("uParameter(parameter: Int!)", parameterMatchers: matchers))
}
}
struct __VerificationProxy_ClassWithOptionals: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
var value: Cuckoo.VerifyProperty<Int?> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "value", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var uValue: Cuckoo.VerifyProperty<Int?> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "uValue", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var array: Cuckoo.VerifyProperty<[Int?]> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "array", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var closure: Cuckoo.VerifyProperty<(Int?) -> Void> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "closure", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var uClosure: Cuckoo.VerifyProperty<(Int?) -> Void> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "uClosure", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
@discardableResult
func returnValue() -> Cuckoo.__DoNotUse<Int?> {
return cuckoo_manager.verify("returnValue() -> Int?", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func returnUValue() -> Cuckoo.__DoNotUse<Int?> {
return cuckoo_manager.verify("returnUValue() -> Int!", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func returnArray() -> Cuckoo.__DoNotUse<[Int?]> {
return cuckoo_manager.verify("returnArray() -> [Int?]", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func parameter<M1: Cuckoo.Matchable>(parameter: M1) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == Int? {
let matchers: [Cuckoo.ParameterMatcher<(Int?)>] = [wrap(matchable: parameter) { $0 }]
return cuckoo_manager.verify("parameter(parameter: Int?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func uParameter<M1: Cuckoo.Matchable>(parameter: M1) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == Int? {
let matchers: [Cuckoo.ParameterMatcher<(Int?)>] = [wrap(matchable: parameter) { $0 }]
return cuckoo_manager.verify("uParameter(parameter: Int!)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
}
}
class ClassWithOptionalsStub: ClassWithOptionals {
override var value: Int? {
get {
return DefaultValueRegistry.defaultValue(for: (Int?).self)
}
set {
}
}
override var uValue: Int! {
get {
return DefaultValueRegistry.defaultValue(for: (Int!).self)
}
set {
}
}
override var array: [Int?] {
get {
return DefaultValueRegistry.defaultValue(for: ([Int?]).self)
}
set {
}
}
override var closure: (Int?) -> Void {
get {
return DefaultValueRegistry.defaultValue(for: ((Int?) -> Void).self)
}
set {
}
}
override var uClosure: (Int!) -> Void {
get {
return DefaultValueRegistry.defaultValue(for: ((Int!) -> Void).self)
}
set {
}
}
override func returnValue() -> Int? {
return DefaultValueRegistry.defaultValue(for: (Int?).self)
}
override func returnUValue() -> Int! {
return DefaultValueRegistry.defaultValue(for: (Int!).self)
}
override func returnArray() -> [Int?] {
return DefaultValueRegistry.defaultValue(for: ([Int?]).self)
}
override func parameter(parameter: Int?) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
override func uParameter(parameter: Int!) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
}

View File

@ -1,527 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/TestedClass.swift
//
// TestedClass.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
class MockTestedClass: TestedClass, Cuckoo.Mock {
typealias MocksType = TestedClass
typealias Stubbing = __StubbingProxy_TestedClass
typealias Verification = __VerificationProxy_TestedClass
let cuckoo_manager = Cuckoo.MockManager()
private var observed: TestedClass?
func spy(on victim: TestedClass) -> Self {
observed = victim
return self
}
override var readOnlyProperty: String {
get {
return cuckoo_manager.getter("readOnlyProperty", original: observed.map { o in return { () -> String in o.readOnlyProperty } })
}
}
override var readWriteProperty: Int {
get {
return cuckoo_manager.getter("readWriteProperty", original: observed.map { o in return { () -> Int in o.readWriteProperty } })
}
set {
cuckoo_manager.setter("readWriteProperty", value: newValue, original: observed != nil ? { self.observed?.readWriteProperty = $0 } : nil)
}
}
override var optionalProperty: Int? {
get {
return cuckoo_manager.getter("optionalProperty", original: observed.map { o in return { () -> Int? in o.optionalProperty } })
}
set {
cuckoo_manager.setter("optionalProperty", value: newValue, original: observed != nil ? { self.observed?.optionalProperty = $0 } : nil)
}
}
override func noReturn() {
return cuckoo_manager.call("noReturn()", parameters: (), original: observed.map { o in return { () in o.noReturn() } })
}
override func count(characters: String) -> Int {
return cuckoo_manager.call("count(characters: String) -> Int", parameters: (characters), original: observed.map { o in return { (characters: String) -> Int in o.count(characters: characters) } })
}
override func withThrows() throws -> Int {
return try cuckoo_manager.callThrows("withThrows() throws -> Int", parameters: (), original: observed.map { o in return { () throws -> Int in try o.withThrows() } })
}
override func withNoReturnThrows() throws {
return try cuckoo_manager.callThrows("withNoReturnThrows() throws", parameters: (), original: observed.map { o in return { () throws in try o.withNoReturnThrows() } })
}
override func withClosure(_ closure: (String) -> Int) -> Int {
return cuckoo_manager.call("withClosure(_: (String) -> Int) -> Int", parameters: (closure), original: observed.map { o in return { (closure: (String) -> Int) -> Int in o.withClosure(closure) } })
}
override func withEscape(_ a: String, action closure: @escaping (String) -> Void) {
return cuckoo_manager.call("withEscape(_: String, action: @escaping (String) -> Void)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: @escaping (String) -> Void) in o.withEscape(a, action: closure) } })
}
override func withOptionalClosure(_ a: String, closure: ((String) -> Void)?) {
return cuckoo_manager.call("withOptionalClosure(_: String, closure: ((String) -> Void)?)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: ((String) -> Void)?) in o.withOptionalClosure(a, closure: closure) } })
}
override func withLabelAndUnderscore(labelA a: String, _ b: String) {
return cuckoo_manager.call("withLabelAndUnderscore(labelA: String, _: String)", parameters: (a, b), original: observed.map { o in return { (a: String, b: String) in o.withLabelAndUnderscore(labelA: a, b) } })
}
struct __StubbingProxy_TestedClass: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
var readOnlyProperty: Cuckoo.ToBeStubbedReadOnlyProperty<String> {
return Cuckoo.ToBeStubbedReadOnlyProperty(manager: cuckoo_manager, name: "readOnlyProperty")
}
var readWriteProperty: Cuckoo.ToBeStubbedProperty<Int> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "readWriteProperty")
}
var optionalProperty: Cuckoo.ToBeStubbedProperty<Int?> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "optionalProperty")
}
func noReturn() -> Cuckoo.StubNoReturnFunction<()> {
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("noReturn()", parameterMatchers: []))
}
func count<M1: Cuckoo.Matchable>(characters: M1) -> Cuckoo.StubFunction<(String), Int> where M1.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: characters) { $0 }]
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("count(characters: String) -> Int", parameterMatchers: matchers))
}
func withThrows() -> Cuckoo.StubThrowingFunction<(), Int> {
return Cuckoo.StubThrowingFunction(stub: cuckoo_manager.createStub("withThrows() throws -> Int", parameterMatchers: []))
}
func withNoReturnThrows() -> Cuckoo.StubNoReturnThrowingFunction<()> {
return Cuckoo.StubNoReturnThrowingFunction(stub: cuckoo_manager.createStub("withNoReturnThrows() throws", parameterMatchers: []))
}
func withClosure<M1: Cuckoo.Matchable>(_ closure: M1) -> Cuckoo.StubFunction<((String) -> Int), Int> where M1.MatchedType == (String) -> Int {
let matchers: [Cuckoo.ParameterMatcher<((String) -> Int)>] = [wrap(matchable: closure) { $0 }]
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("withClosure(_: (String) -> Int) -> Int", parameterMatchers: matchers))
}
func withEscape<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, action closure: M2) -> Cuckoo.StubNoReturnFunction<(String, (String) -> Void)> where M1.MatchedType == String, M2.MatchedType == (String) -> Void {
let matchers: [Cuckoo.ParameterMatcher<(String, (String) -> Void)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withEscape(_: String, action: @escaping (String) -> Void)", parameterMatchers: matchers))
}
func withOptionalClosure<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, closure: M2) -> Cuckoo.StubNoReturnFunction<(String, ((String) -> Void)?)> where M1.MatchedType == String, M2.MatchedType == ((String) -> Void)? {
let matchers: [Cuckoo.ParameterMatcher<(String, ((String) -> Void)?)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withOptionalClosure(_: String, closure: ((String) -> Void)?)", parameterMatchers: matchers))
}
func withLabelAndUnderscore<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(labelA a: M1, _ b: M2) -> Cuckoo.StubNoReturnFunction<(String, String)> where M1.MatchedType == String, M2.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String, String)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: b) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withLabelAndUnderscore(labelA: String, _: String)", parameterMatchers: matchers))
}
}
struct __VerificationProxy_TestedClass: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
var readOnlyProperty: Cuckoo.VerifyReadOnlyProperty<String> {
return Cuckoo.VerifyReadOnlyProperty(manager: cuckoo_manager, name: "readOnlyProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var readWriteProperty: Cuckoo.VerifyProperty<Int> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "readWriteProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var optionalProperty: Cuckoo.VerifyProperty<Int?> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "optionalProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
@discardableResult
func noReturn() -> Cuckoo.__DoNotUse<Void> {
return cuckoo_manager.verify("noReturn()", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func count<M1: Cuckoo.Matchable>(characters: M1) -> Cuckoo.__DoNotUse<Int> where M1.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: characters) { $0 }]
return cuckoo_manager.verify("count(characters: String) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withThrows() -> Cuckoo.__DoNotUse<Int> {
return cuckoo_manager.verify("withThrows() throws -> Int", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func withNoReturnThrows() -> Cuckoo.__DoNotUse<Void> {
return cuckoo_manager.verify("withNoReturnThrows() throws", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func withClosure<M1: Cuckoo.Matchable>(_ closure: M1) -> Cuckoo.__DoNotUse<Int> where M1.MatchedType == (String) -> Int {
let matchers: [Cuckoo.ParameterMatcher<((String) -> Int)>] = [wrap(matchable: closure) { $0 }]
return cuckoo_manager.verify("withClosure(_: (String) -> Int) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withEscape<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, action closure: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == (String) -> Void {
let matchers: [Cuckoo.ParameterMatcher<(String, (String) -> Void)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return cuckoo_manager.verify("withEscape(_: String, action: @escaping (String) -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withOptionalClosure<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, closure: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == ((String) -> Void)? {
let matchers: [Cuckoo.ParameterMatcher<(String, ((String) -> Void)?)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return cuckoo_manager.verify("withOptionalClosure(_: String, closure: ((String) -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withLabelAndUnderscore<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(labelA a: M1, _ b: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String, String)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: b) { $0.1 }]
return cuckoo_manager.verify("withLabelAndUnderscore(labelA: String, _: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
}
}
class TestedClassStub: TestedClass {
override var readOnlyProperty: String {
get {
return DefaultValueRegistry.defaultValue(for: (String).self)
}
}
override var readWriteProperty: Int {
get {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
set {
}
}
override var optionalProperty: Int? {
get {
return DefaultValueRegistry.defaultValue(for: (Int?).self)
}
set {
}
}
override func noReturn() {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
override func count(characters: String) -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
override func withThrows() throws -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
override func withNoReturnThrows() throws {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
override func withClosure(_ closure: (String) -> Int) -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
override func withEscape(_ a: String, action closure: @escaping (String) -> Void) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
override func withOptionalClosure(_ a: String, closure: ((String) -> Void)?) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
override func withLabelAndUnderscore(labelA a: String, _ b: String) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
}
// MARK: - Mocks generated from file: SourceFiles/TestedProtocol.swift
//
// TestedProtocol.swift
// Cuckoo
//
// Created by Tadeas Kriz on 18/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
class MockTestedProtocol: TestedProtocol, Cuckoo.Mock {
typealias MocksType = TestedProtocol
typealias Stubbing = __StubbingProxy_TestedProtocol
typealias Verification = __VerificationProxy_TestedProtocol
let cuckoo_manager = Cuckoo.MockManager()
private var observed: TestedProtocol?
func spy(on victim: TestedProtocol) -> Self {
observed = victim
return self
}
var readOnlyProperty: String {
get {
return cuckoo_manager.getter("readOnlyProperty", original: observed.map { o in return { () -> String in o.readOnlyProperty } })
}
}
var readWriteProperty: Int {
get {
return cuckoo_manager.getter("readWriteProperty", original: observed.map { o in return { () -> Int in o.readWriteProperty } })
}
set {
cuckoo_manager.setter("readWriteProperty", value: newValue, original: observed != nil ? { self.observed?.readWriteProperty = $0 } : nil)
}
}
var optionalProperty: Int? {
get {
return cuckoo_manager.getter("optionalProperty", original: observed.map { o in return { () -> Int? in o.optionalProperty } })
}
set {
cuckoo_manager.setter("optionalProperty", value: newValue, original: observed != nil ? { self.observed?.optionalProperty = $0 } : nil)
}
}
func noReturn() {
return cuckoo_manager.call("noReturn()", parameters: (), original: observed.map { o in return { () in o.noReturn() } })
}
func count(characters: String) -> Int {
return cuckoo_manager.call("count(characters: String) -> Int", parameters: (characters), original: observed.map { o in return { (characters: String) -> Int in o.count(characters: characters) } })
}
func withThrows() throws -> Int {
return try cuckoo_manager.callThrows("withThrows() throws -> Int", parameters: (), original: observed.map { o in return { () throws -> Int in try o.withThrows() } })
}
func withNoReturnThrows() throws {
return try cuckoo_manager.callThrows("withNoReturnThrows() throws", parameters: (), original: observed.map { o in return { () throws in try o.withNoReturnThrows() } })
}
func withClosure(_ closure: (String) -> Int) -> Int {
return cuckoo_manager.call("withClosure(_: (String) -> Int) -> Int", parameters: (closure), original: observed.map { o in return { (closure: (String) -> Int) -> Int in o.withClosure(closure) } })
}
func withEscape(_ a: String, action closure: @escaping (String) -> Void) {
return cuckoo_manager.call("withEscape(_: String, action: @escaping (String) -> Void)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: @escaping (String) -> Void) in o.withEscape(a, action: closure) } })
}
func withOptionalClosure(_ a: String, closure: ((String) -> Void)?) {
return cuckoo_manager.call("withOptionalClosure(_: String, closure: ((String) -> Void)?)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: ((String) -> Void)?) in o.withOptionalClosure(a, closure: closure) } })
}
func withLabelAndUnderscore(labelA a: String, _ b: String) {
return cuckoo_manager.call("withLabelAndUnderscore(labelA: String, _: String)", parameters: (a, b), original: observed.map { o in return { (a: String, b: String) in o.withLabelAndUnderscore(labelA: a, b) } })
}
struct __StubbingProxy_TestedProtocol: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
var readOnlyProperty: Cuckoo.ToBeStubbedReadOnlyProperty<String> {
return Cuckoo.ToBeStubbedReadOnlyProperty(manager: cuckoo_manager, name: "readOnlyProperty")
}
var readWriteProperty: Cuckoo.ToBeStubbedProperty<Int> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "readWriteProperty")
}
var optionalProperty: Cuckoo.ToBeStubbedProperty<Int?> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "optionalProperty")
}
func noReturn() -> Cuckoo.StubNoReturnFunction<()> {
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("noReturn()", parameterMatchers: []))
}
func count<M1: Cuckoo.Matchable>(characters: M1) -> Cuckoo.StubFunction<(String), Int> where M1.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: characters) { $0 }]
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("count(characters: String) -> Int", parameterMatchers: matchers))
}
func withThrows() -> Cuckoo.StubThrowingFunction<(), Int> {
return Cuckoo.StubThrowingFunction(stub: cuckoo_manager.createStub("withThrows() throws -> Int", parameterMatchers: []))
}
func withNoReturnThrows() -> Cuckoo.StubNoReturnThrowingFunction<()> {
return Cuckoo.StubNoReturnThrowingFunction(stub: cuckoo_manager.createStub("withNoReturnThrows() throws", parameterMatchers: []))
}
func withClosure<M1: Cuckoo.Matchable>(_ closure: M1) -> Cuckoo.StubFunction<((String) -> Int), Int> where M1.MatchedType == (String) -> Int {
let matchers: [Cuckoo.ParameterMatcher<((String) -> Int)>] = [wrap(matchable: closure) { $0 }]
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("withClosure(_: (String) -> Int) -> Int", parameterMatchers: matchers))
}
func withEscape<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, action closure: M2) -> Cuckoo.StubNoReturnFunction<(String, (String) -> Void)> where M1.MatchedType == String, M2.MatchedType == (String) -> Void {
let matchers: [Cuckoo.ParameterMatcher<(String, (String) -> Void)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withEscape(_: String, action: @escaping (String) -> Void)", parameterMatchers: matchers))
}
func withOptionalClosure<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, closure: M2) -> Cuckoo.StubNoReturnFunction<(String, ((String) -> Void)?)> where M1.MatchedType == String, M2.MatchedType == ((String) -> Void)? {
let matchers: [Cuckoo.ParameterMatcher<(String, ((String) -> Void)?)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withOptionalClosure(_: String, closure: ((String) -> Void)?)", parameterMatchers: matchers))
}
func withLabelAndUnderscore<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(labelA a: M1, _ b: M2) -> Cuckoo.StubNoReturnFunction<(String, String)> where M1.MatchedType == String, M2.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String, String)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: b) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withLabelAndUnderscore(labelA: String, _: String)", parameterMatchers: matchers))
}
}
struct __VerificationProxy_TestedProtocol: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
var readOnlyProperty: Cuckoo.VerifyReadOnlyProperty<String> {
return Cuckoo.VerifyReadOnlyProperty(manager: cuckoo_manager, name: "readOnlyProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var readWriteProperty: Cuckoo.VerifyProperty<Int> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "readWriteProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var optionalProperty: Cuckoo.VerifyProperty<Int?> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "optionalProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
@discardableResult
func noReturn() -> Cuckoo.__DoNotUse<Void> {
return cuckoo_manager.verify("noReturn()", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func count<M1: Cuckoo.Matchable>(characters: M1) -> Cuckoo.__DoNotUse<Int> where M1.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: characters) { $0 }]
return cuckoo_manager.verify("count(characters: String) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withThrows() -> Cuckoo.__DoNotUse<Int> {
return cuckoo_manager.verify("withThrows() throws -> Int", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func withNoReturnThrows() -> Cuckoo.__DoNotUse<Void> {
return cuckoo_manager.verify("withNoReturnThrows() throws", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func withClosure<M1: Cuckoo.Matchable>(_ closure: M1) -> Cuckoo.__DoNotUse<Int> where M1.MatchedType == (String) -> Int {
let matchers: [Cuckoo.ParameterMatcher<((String) -> Int)>] = [wrap(matchable: closure) { $0 }]
return cuckoo_manager.verify("withClosure(_: (String) -> Int) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withEscape<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, action closure: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == (String) -> Void {
let matchers: [Cuckoo.ParameterMatcher<(String, (String) -> Void)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return cuckoo_manager.verify("withEscape(_: String, action: @escaping (String) -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withOptionalClosure<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, closure: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == ((String) -> Void)? {
let matchers: [Cuckoo.ParameterMatcher<(String, ((String) -> Void)?)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return cuckoo_manager.verify("withOptionalClosure(_: String, closure: ((String) -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withLabelAndUnderscore<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(labelA a: M1, _ b: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String, String)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: b) { $0.1 }]
return cuckoo_manager.verify("withLabelAndUnderscore(labelA: String, _: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
}
}
class TestedProtocolStub: TestedProtocol {
var readOnlyProperty: String {
get {
return DefaultValueRegistry.defaultValue(for: (String).self)
}
}
var readWriteProperty: Int {
get {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
set {
}
}
var optionalProperty: Int? {
get {
return DefaultValueRegistry.defaultValue(for: (Int?).self)
}
set {
}
}
func noReturn() {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func count(characters: String) -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
func withThrows() throws -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
func withNoReturnThrows() throws {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func withClosure(_ closure: (String) -> Int) -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
func withEscape(_ a: String, action closure: @escaping (String) -> Void) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func withOptionalClosure(_ a: String, closure: ((String) -> Void)?) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func withLabelAndUnderscore(labelA a: String, _ b: String) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
}

View File

@ -1,57 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/Imports.swift
//
// Imports.swift
// Cuckoo
//
// Created by Tadeas Kriz on 18/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
import a
import b
import c
import d
import e
import f
import g
import h
import i
class MockA: A, Cuckoo.Mock {
typealias MocksType = A
typealias Stubbing = __StubbingProxy_A
typealias Verification = __VerificationProxy_A
let cuckoo_manager = Cuckoo.MockManager()
private var observed: A?
func spy(on victim: A) -> Self {
observed = victim
return self
}
struct __StubbingProxy_A: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
}
struct __VerificationProxy_A: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
}
}
class AStub: A {
}

View File

@ -1,84 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/MultipleClasses.swift
//
// MultipleClasses.swift
// Cuckoo
//
// Created by Tadeas Kriz on 18/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
class MockA: A, Cuckoo.Mock {
typealias MocksType = A
typealias Stubbing = __StubbingProxy_A
typealias Verification = __VerificationProxy_A
let cuckoo_manager = Cuckoo.MockManager()
private var observed: A?
func spy(on victim: A) -> Self {
observed = victim
return self
}
struct __StubbingProxy_A: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
}
struct __VerificationProxy_A: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
}
}
class AStub: A {
}
class MockB: B, Cuckoo.Mock {
typealias MocksType = B
typealias Stubbing = __StubbingProxy_B
typealias Verification = __VerificationProxy_B
let cuckoo_manager = Cuckoo.MockManager()
private var observed: B?
func spy(on victim: B) -> Self {
observed = victim
return self
}
struct __StubbingProxy_B: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
}
struct __VerificationProxy_B: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
}
}
class BStub: B {
}

View File

@ -1,40 +0,0 @@
import Cuckoo
import Foundation
class MockEmptyClass: EmptyClass, Cuckoo.Mock {
typealias MocksType = EmptyClass
typealias Stubbing = __StubbingProxy_EmptyClass
typealias Verification = __VerificationProxy_EmptyClass
let cuckoo_manager = Cuckoo.MockManager()
private var observed: EmptyClass?
func spy(on victim: EmptyClass) -> Self {
observed = victim
return self
}
struct __StubbingProxy_EmptyClass: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
}
struct __VerificationProxy_EmptyClass: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
}
}
class EmptyClassStub: EmptyClass {
}

View File

@ -1,10 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/Struct.swift
//
// Struct.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo

View File

@ -1,53 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/EmptyClass.swift
//
// EmptyClass.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
@testable import Cuckoo
@testable import A_b
@testable import A_c
@testable import A_d
import Foundation
class MockEmptyClass: EmptyClass, Cuckoo.Mock {
typealias MocksType = EmptyClass
typealias Stubbing = __StubbingProxy_EmptyClass
typealias Verification = __VerificationProxy_EmptyClass
let cuckoo_manager = Cuckoo.MockManager()
private var observed: EmptyClass?
func spy(on victim: EmptyClass) -> Self {
observed = victim
return self
}
struct __StubbingProxy_EmptyClass: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
}
struct __VerificationProxy_EmptyClass: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
}
}
class EmptyClassStub: EmptyClass {
}

View File

@ -1,263 +0,0 @@
// MARK: - Mocks generated from file: SourceFiles/TestedProtocol.swift
//
// TestedProtocol.swift
// Cuckoo
//
// Created by Tadeas Kriz on 18/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import Cuckoo
class MockTestedProtocol: TestedProtocol, Cuckoo.Mock {
typealias MocksType = TestedProtocol
typealias Stubbing = __StubbingProxy_TestedProtocol
typealias Verification = __VerificationProxy_TestedProtocol
let cuckoo_manager = Cuckoo.MockManager()
private var observed: TestedProtocol?
func spy(on victim: TestedProtocol) -> Self {
observed = victim
return self
}
var readOnlyProperty: String {
get {
return cuckoo_manager.getter("readOnlyProperty", original: observed.map { o in return { () -> String in o.readOnlyProperty } })
}
}
var readWriteProperty: Int {
get {
return cuckoo_manager.getter("readWriteProperty", original: observed.map { o in return { () -> Int in o.readWriteProperty } })
}
set {
cuckoo_manager.setter("readWriteProperty", value: newValue, original: observed != nil ? { self.observed?.readWriteProperty = $0 } : nil)
}
}
var optionalProperty: Int? {
get {
return cuckoo_manager.getter("optionalProperty", original: observed.map { o in return { () -> Int? in o.optionalProperty } })
}
set {
cuckoo_manager.setter("optionalProperty", value: newValue, original: observed != nil ? { self.observed?.optionalProperty = $0 } : nil)
}
}
func noReturn() {
return cuckoo_manager.call("noReturn()", parameters: (), original: observed.map { o in return { () in o.noReturn() } })
}
func count(characters: String) -> Int {
return cuckoo_manager.call("count(characters: String) -> Int", parameters: (characters), original: observed.map { o in return { (characters: String) -> Int in o.count(characters: characters) } })
}
func withThrows() throws -> Int {
return try cuckoo_manager.callThrows("withThrows() throws -> Int", parameters: (), original: observed.map { o in return { () throws -> Int in try o.withThrows() } })
}
func withNoReturnThrows() throws {
return try cuckoo_manager.callThrows("withNoReturnThrows() throws", parameters: (), original: observed.map { o in return { () throws in try o.withNoReturnThrows() } })
}
func withClosure(_ closure: (String) -> Int) -> Int {
return cuckoo_manager.call("withClosure(_: (String) -> Int) -> Int", parameters: (closure), original: observed.map { o in return { (closure: (String) -> Int) -> Int in o.withClosure(closure) } })
}
func withEscape(_ a: String, action closure: @escaping (String) -> Void) {
return cuckoo_manager.call("withEscape(_: String, action: @escaping (String) -> Void)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: @escaping (String) -> Void) in o.withEscape(a, action: closure) } })
}
func withOptionalClosure(_ a: String, closure: ((String) -> Void)?) {
return cuckoo_manager.call("withOptionalClosure(_: String, closure: ((String) -> Void)?)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: ((String) -> Void)?) in o.withOptionalClosure(a, closure: closure) } })
}
func withLabelAndUnderscore(labelA a: String, _ b: String) {
return cuckoo_manager.call("withLabelAndUnderscore(labelA: String, _: String)", parameters: (a, b), original: observed.map { o in return { (a: String, b: String) in o.withLabelAndUnderscore(labelA: a, b) } })
}
struct __StubbingProxy_TestedProtocol: Cuckoo.StubbingProxy {
private let cuckoo_manager: Cuckoo.MockManager
init(manager: Cuckoo.MockManager) {
self.manager = cuckoo_manager
}
var readOnlyProperty: Cuckoo.ToBeStubbedReadOnlyProperty<String> {
return Cuckoo.ToBeStubbedReadOnlyProperty(manager: cuckoo_manager, name: "readOnlyProperty")
}
var readWriteProperty: Cuckoo.ToBeStubbedProperty<Int> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "readWriteProperty")
}
var optionalProperty: Cuckoo.ToBeStubbedProperty<Int?> {
return Cuckoo.ToBeStubbedProperty(manager: cuckoo_manager, name: "optionalProperty")
}
func noReturn() -> Cuckoo.StubNoReturnFunction<()> {
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("noReturn()", parameterMatchers: []))
}
func count<M1: Cuckoo.Matchable>(characters: M1) -> Cuckoo.StubFunction<(String), Int> where M1.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: characters) { $0 }]
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("count(characters: String) -> Int", parameterMatchers: matchers))
}
func withThrows() -> Cuckoo.StubThrowingFunction<(), Int> {
return Cuckoo.StubThrowingFunction(stub: cuckoo_manager.createStub("withThrows() throws -> Int", parameterMatchers: []))
}
func withNoReturnThrows() -> Cuckoo.StubNoReturnThrowingFunction<()> {
return Cuckoo.StubNoReturnThrowingFunction(stub: cuckoo_manager.createStub("withNoReturnThrows() throws", parameterMatchers: []))
}
func withClosure<M1: Cuckoo.Matchable>(_ closure: M1) -> Cuckoo.StubFunction<((String) -> Int), Int> where M1.MatchedType == (String) -> Int {
let matchers: [Cuckoo.ParameterMatcher<((String) -> Int)>] = [wrap(matchable: closure) { $0 }]
return Cuckoo.StubFunction(stub: cuckoo_manager.createStub("withClosure(_: (String) -> Int) -> Int", parameterMatchers: matchers))
}
func withEscape<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, action closure: M2) -> Cuckoo.StubNoReturnFunction<(String, (String) -> Void)> where M1.MatchedType == String, M2.MatchedType == (String) -> Void {
let matchers: [Cuckoo.ParameterMatcher<(String, (String) -> Void)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withEscape(_: String, action: @escaping (String) -> Void)", parameterMatchers: matchers))
}
func withOptionalClosure<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, closure: M2) -> Cuckoo.StubNoReturnFunction<(String, ((String) -> Void)?)> where M1.MatchedType == String, M2.MatchedType == ((String) -> Void)? {
let matchers: [Cuckoo.ParameterMatcher<(String, ((String) -> Void)?)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withOptionalClosure(_: String, closure: ((String) -> Void)?)", parameterMatchers: matchers))
}
func withLabelAndUnderscore<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(labelA a: M1, _ b: M2) -> Cuckoo.StubNoReturnFunction<(String, String)> where M1.MatchedType == String, M2.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String, String)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: b) { $0.1 }]
return Cuckoo.StubNoReturnFunction(stub: cuckoo_manager.createStub("withLabelAndUnderscore(labelA: String, _: String)", parameterMatchers: matchers))
}
}
struct __VerificationProxy_TestedProtocol: Cuckoo.VerificationProxy {
private let cuckoo_manager: Cuckoo.MockManager
private let callMatcher: Cuckoo.CallMatcher
private let sourceLocation: Cuckoo.SourceLocation
init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {
self.manager = cuckoo_manager
self.callMatcher = callMatcher
self.sourceLocation = sourceLocation
}
var readOnlyProperty: Cuckoo.VerifyReadOnlyProperty<String> {
return Cuckoo.VerifyReadOnlyProperty(manager: cuckoo_manager, name: "readOnlyProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var readWriteProperty: Cuckoo.VerifyProperty<Int> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "readWriteProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
var optionalProperty: Cuckoo.VerifyProperty<Int?> {
return Cuckoo.VerifyProperty(manager: cuckoo_manager, name: "optionalProperty", callMatcher: callMatcher, sourceLocation: sourceLocation)
}
@discardableResult
func noReturn() -> Cuckoo.__DoNotUse<Void> {
return cuckoo_manager.verify("noReturn()", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func count<M1: Cuckoo.Matchable>(characters: M1) -> Cuckoo.__DoNotUse<Int> where M1.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: characters) { $0 }]
return cuckoo_manager.verify("count(characters: String) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withThrows() -> Cuckoo.__DoNotUse<Int> {
return cuckoo_manager.verify("withThrows() throws -> Int", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func withNoReturnThrows() -> Cuckoo.__DoNotUse<Void> {
return cuckoo_manager.verify("withNoReturnThrows() throws", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher<Void>], sourceLocation: sourceLocation)
}
@discardableResult
func withClosure<M1: Cuckoo.Matchable>(_ closure: M1) -> Cuckoo.__DoNotUse<Int> where M1.MatchedType == (String) -> Int {
let matchers: [Cuckoo.ParameterMatcher<((String) -> Int)>] = [wrap(matchable: closure) { $0 }]
return cuckoo_manager.verify("withClosure(_: (String) -> Int) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withEscape<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, action closure: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == (String) -> Void {
let matchers: [Cuckoo.ParameterMatcher<(String, (String) -> Void)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return cuckoo_manager.verify("withEscape(_: String, action: @escaping (String) -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withOptionalClosure<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(_ a: M1, closure: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == ((String) -> Void)? {
let matchers: [Cuckoo.ParameterMatcher<(String, ((String) -> Void)?)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: closure) { $0.1 }]
return cuckoo_manager.verify("withOptionalClosure(_: String, closure: ((String) -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
@discardableResult
func withLabelAndUnderscore<M1: Cuckoo.Matchable, M2: Cuckoo.Matchable>(labelA a: M1, _ b: M2) -> Cuckoo.__DoNotUse<Void> where M1.MatchedType == String, M2.MatchedType == String {
let matchers: [Cuckoo.ParameterMatcher<(String, String)>] = [wrap(matchable: a) { $0.0 }, wrap(matchable: b) { $0.1 }]
return cuckoo_manager.verify("withLabelAndUnderscore(labelA: String, _: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation)
}
}
}
class TestedProtocolStub: TestedProtocol {
var readOnlyProperty: String {
get {
return DefaultValueRegistry.defaultValue(for: (String).self)
}
}
var readWriteProperty: Int {
get {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
set {
}
}
var optionalProperty: Int? {
get {
return DefaultValueRegistry.defaultValue(for: (Int?).self)
}
set {
}
}
func noReturn() {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func count(characters: String) -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
func withThrows() throws -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
func withNoReturnThrows() throws {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func withClosure(_ closure: (String) -> Int) -> Int {
return DefaultValueRegistry.defaultValue(for: (Int).self)
}
func withEscape(_ a: String, action closure: @escaping (String) -> Void) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func withOptionalClosure(_ a: String, closure: ((String) -> Void)?) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
func withLabelAndUnderscore(labelA a: String, _ b: String) {
return DefaultValueRegistry.defaultValue(for: (Void).self)
}
}

View File

@ -1,12 +0,0 @@
//
// ImplicitInstanceVariableType.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
class ImplicitInstanceVariableType {
var variable = 5
}

View File

@ -1,32 +0,0 @@
//
// Imports.swift
// Cuckoo
//
// Created by Tadeas Kriz on 18/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
import c;import d
import a; import b
import e
import
f
import //aaa
g
import /* aaa */h
// Class A
class A {
let text = " import x "
}
import i
import i
extension A {
var text2: String {
return " import y "
}
}

View File

@ -1,13 +0,0 @@
//
// MultipleClasses.swift
// Cuckoo
//
// Created by Tadeas Kriz on 18/01/16.
// Copyright © 2016 Brightify. All rights reserved.
//
class A {
}
class B {
}

View File

@ -1,10 +0,0 @@
//
// Struct.swift
// Cuckoo
//
// Created by Tadeas Kriz on 09/02/16.
// Copyright © 2016 Brightify. All rights reserved.
//
struct Struct {
}

Some files were not shown because too many files have changed in this diff Show More