Code Monkey home page Code Monkey logo

specleaks's People

Contributors

igorkulman avatar josueruiz7 avatar leandromperez avatar mstankiewiczzen avatar turekj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

specleaks's Issues

Conversion to Swift 5

Hi !

Thank you for this very cool library.
With Swift 5, there is a warning because the library was not build with Swift 5.
I think there are not so many changes since 4.2, so maybe a new version with swift version updated could be useful for every Swift 5 users :)

Version not works

Hi!
Build doesn't work. Could you explain the right way to install library, please?

Use of unresolved identifier 'leak'

First of all, thank you for this library, I am excited to start using it.

It appears I am getting this error because Matchers.swift was only added after the first POD release.

Please could you deploy a new release?

Add macOS support

I'm using Carthage and would love to use this tool, however it doesn't seem to support macOS. Not sure if this is the same with CocoaPods? Would it be possible to support the desktop platform?

Carthage build fails with Xcode 11.4

After updating to Xcode 11.4 I cannot build the library anymore via Carthage

Ld /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/x86_64/Binary/SpecLeaks normal x86_64 (in target 'SpecLeaks' from project 'SpecLeaks')
    cd /Users/igorkulman/Projects/open-source/iOSSampleApp/Sources/Carthage/Checkouts/specleaks
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios10.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk -L/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Products/Release-iphonesimulator -F/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Products/Release-iphonesimulator -F/Users/igorkulman/Projects/open-source/iOSSampleApp/Sources/Carthage/Checkouts/specleaks/Carthage/Build/iOS -filelist /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/x86_64/SpecLeaks.LinkFileList -install_name @rpath/SpecLeaks.framework/SpecLeaks -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/x86_64/SpecLeaks_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/x86_64/SpecLeaks.swiftmodule -framework Quick -framework Nimble -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/x86_64/SpecLeaks_dependency_info.dat -o /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/x86_64/Binary/SpecLeaks
ld: warning: Could not find or use auto-linked library 'XCTestSwiftSupport'
ld: warning: Could not find or use auto-linked framework 'XCTest'
Undefined symbols for architecture x86_64:
  "__swift_FORCE_LOAD_$_XCTestSwiftSupport", referenced from:
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in LeaksAnalyzer.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in Expectation+Leaks.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in Matchers.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in AnalyzeLeakAction.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in LeakTest.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in AnalyzeLeak.o

Ld /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/i386/Binary/SpecLeaks normal i386 (in target 'SpecLeaks' from project 'SpecLeaks')
    cd /Users/igorkulman/Projects/open-source/iOSSampleApp/Sources/Carthage/Checkouts/specleaks
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target i386-apple-ios10.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk -L/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Products/Release-iphonesimulator -F/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Products/Release-iphonesimulator -F/Users/igorkulman/Projects/open-source/iOSSampleApp/Sources/Carthage/Checkouts/specleaks/Carthage/Build/iOS -filelist /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/i386/SpecLeaks.LinkFileList -install_name @rpath/SpecLeaks.framework/SpecLeaks -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/i386/SpecLeaks_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/i386/SpecLeaks.swiftmodule -framework Quick -framework Nimble -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/i386/SpecLeaks_dependency_info.dat -o /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/build/5.2+f58d9b74f6b642adce092215d0238d3c/specleaks/0.1.8/Build/Intermediates.noindex/SpecLeaks.build/Release-iphonesimulator/SpecLeaks.build/Objects-normal/i386/Binary/SpecLeaks
ld: warning: Could not find or use auto-linked library 'XCTestSwiftSupport'
ld: warning: Could not find or use auto-linked framework 'XCTest'
Undefined symbols for architecture i386:
  "__swift_FORCE_LOAD_$_XCTestSwiftSupport", referenced from:
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in LeaksAnalyzer.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in Expectation+Leaks.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in Matchers.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in AnalyzeLeakAction.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in LeakTest.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks in AnalyzeLeak.o
     (maybe you meant: __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_SpecLeaks)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

static function escaping closure in Dispatch block using in VC test leak but deinit call

Hi
when I use this framework to test does function has leak. Code is like below. test unit shows it has leak, but when I use deinit to test is the viewcontroller is free, the deinit function called. and when I check memory graph, it seems no leak. can you help me to figure out why the test unit shows leak?

Function define

struct SchoolModel{ }

extension SchoolModel{
  static func loadData(completion: @escaping ([String]) -> Void){
    DispatchQueue.main.async {
      completion([])
    } 
  }
}

Using in viewcontroller

import UIKit
 
class ViewController: UIViewController {
  
  var completeData:[String] = []
  override func viewDidLoad() {
    super.viewDidLoad()
    SchoolModel.loadData { (data) in
      self.completeData = data
    }
  }
  deinit {
    print("\(#function)")
  } 
}

Test code

import Nimble
import Quick
import SpecLeaks

@testable import LeakTry

class leakTest: QuickSpec {
  override func spec() {
    describe("") {
      let test = LeakTest {
        let vc = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "ViewController") as! ViewController
        return vc
      }
      describe("init") {
        it("must not leak") {
          expect(test).toNot(leak())
        }
      }
    }
  }
}

Nimble 9.0 has breaking changes

There is a release candidate for version 9 of Nimble available that has support for XCode 12 (more info here). However, updating to Nimble 9 breaks this Pod.

I have attached a screenshot that indicates specifically which file/part of the code is causing the compilation issues, it is just a type mismatch between TimeInterval and DispatchTimeInterval in Expectation+Leaks.swift.
Screen Shot 2020-09-23 at 11 17 42 AM

Getting error for bitcode enable

ld: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Problem with pod

I tried to import SpecLeaks with cocoapods (specifying pod 'SpecLeaks' in my podfile), but it seems that many files are missing.

In fact, I only got LeakTest.swift, but all the other files are not downloaded.

Maybe there is a problem with your pod configuration ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.