BDD-style framework for Swift

Related tags

Testing Sleipnir
Overview

Sleipnir

Sleipnir is a BDD-style framework for Swift. Sleipnir is highly inspired by Cedar. Also

In Norse mythology, Sleipnir is Odin's steed, is the child of Loki and Svaðilfari, is described as the best of all horses, and is sometimes ridden to the location of Hel.

class SampleSpec : SleipnirSpec {
    var spec : () = describe("Horse") {
        context("usual") {
            it("is not awesome") {
                let usualHorse = UsualHorse()
                usualHorse.legsCount.should.equal(4)
                expect(usualHorse.isAwesome()).to(beFalse())
            }
        }
        
        context("Sleipnir") {
            it("is awesome") {
                let sleipnirHorse = Sleipnir()
                sleipnirHorse.legsCount.should.equal(8)
                expect(sleipnirHorse.isAwesome()).to(beTrue())
            }
        }
    }
}

Core principles

  • Sleipnir is not dependent of NSObject, it is pure Swift BDD testing framework
  • Sleipnir is not using XCTest
  • Sleipnir has nice command line output and support for custom test reporters
  • Other features, like seeded random tests invocation, focused and excluded examples/groups, etc.

Installation

Manually (preferred way)

  1. Add Sleipnir as a submodule: git submodule add https://github.com/railsware/sleipnir ThirdParty/Sleipnir
  2. Drag'n'drop Sleipnir.xcodeproj to your test target
  3. Link Sleipnir.framework
  4. Start writing specs!

Manually (from XCode Project template)

  1. Clone Sleipnir repo git clone https://github.com/railsware/sleipnir /tmp/Sleipnir
  2. Execute the following command cd /tmp/Sleipnir && make install_templates

The command will install templates for OSX and iOS projects and Spec file template as well.

Note: this way you should manage framework updates on your own. Try to reinstall templates before creating new project/target from "old" ones

Via CocoaPods

You can install statically built Sleipnir.framework into you project simply by adding it to the Podfile

pod 'Sleipnir'

Note: it is experimental way
Current build does not work on iPhone Simulator, but works for OSX and iOS Devices

Usage sample

See LibrarySpec file in Sample project.

Writing specs

All spec classes should inherit from SleipnirSpec.

Root ExampleGroups in a spec should be assigned to some void variable. This allows specs to initialize correctly:

import Sleipnir

class SomeSpec : SleipnirSpec {
 
    let someSpec : () = describe("Some spec") {
        it("should pass") {
            expect(1).to(equal(1))
        }
    }
    
}

Running specs

In order to run your specs you should invoke Runner.run() from the main.swift of your test target.

The default test runner will produce the following command line output, indicating all the failures and some meta information about each failure:

Running With Random Seed: 1234

.....F..


FAILURE Some spec should pass:
/Path/To/Your/Specs/TestSpec.swift:16 Expected <1> to equal <2>


Finished in 0.0075 seconds

8 examples, 1 failures

Seeded random specs run

All examples would run in random order with the random seed specified in output. If you would like to re-run tests in the same order you should pass a seed to run() method:

Runner.run(seed: 1234)

Examples and ExampleGroups

ExampleGroups are created with describe or context keywords. Within the block passed to ExampleGroup you can declare examples using the it keyword.

ExampleGroups can be nested in order to create clean structure of your tests.

Under the hood describe method creates an instance of ExampleGroup and evaluates the block passed to it. Blocks passed to examples are evaluated dynamically during the test execution.

Setup/Teardown code

Sleipnir supports some hooks to execute before or after examples. This allows to share some setup/teardown code between examples.

beforeEach block will be executed before each example in the current group and all nested groups.

afterEach block will be executed after each example.

class SomeSpec : SleipnirSpec {
 
    let someSpec : () = describe("Some spec") {
        var someArray: [Int]?
        beforeEach {
            someArray = [1, 2, 3]
        }
        
        afterEach {
            someArray = nil
        }
        
        it("should pass") {
            expect(someArray).toNot(beNil())
            expect(someArray).to(contain(3))
        }
    }
    
}

You can also specify global setup/teardown blocks using beforeAll and afterAll keywords. They will run once before or after all examples in the current group and all the nested groups.

Focused and excluded specs

You can specify examples and example groups to be focused by placing f letter before declaration: fdescribe, fcontext, fit. In this case the spec runner will only run focused examples/example groups and ignore all the others.

You can also mark an example or example group as pending. It won't run but will be printed along with the test results.
To mark something as pending add an x letter before declaration: xdescribe, xcontext, xit.
Example can also be marked as pending by passing PENDING instead of spec block:

it("is pending", PENDING)

Shared example groups

Sleipnir supports extracting common specs through shared example groups.
They can include any number of it, context, describe, before and after blocks.
You can pass example-specific state into the shared example group through sharedContext dictionary.

var nonNilObject : () =
    sharedExamplesFor("a non-nil object") { (sharedContext : SharedContext) in
        var object: AnyObject?
        beforeEach {
            object = sharedContext()["object"]
        }
        
        it("should not be nil") {
            expect(object).toNot(beNil())
        }
    }

var spec : () = context("A non-nil object") {
    let someObject: String = "Some Object"
    itShouldBehaveLike("a non-nil object", { ["object" : someObject] })
}

If you don't need any context, you can use closures without parameters:

sharedExamplesFor("some awesome stuff") {
    it("should be awesome") {
        //...
    }
}

describe("Some stuff") {
    itShouldBehaveLike("some awesome stuff")
}

Expectations

Sleipnir supports defining expectations using expect(someValue/expession).to(SomeMatcher) syntax.

expect(true).to(beTrue())

expect method supports passing values or a block of code in a closure:

expect {
    var x = 1
    x++
    return x
}.to(equal(2))

Should syntax

In addition to the expect syntax, Sleipnir supports the should syntax:

actual.should.equal(expected)
[1, 2, 3].shouldNot.contain(4)

See detailed information on the should syntax and its usage

Available matchers

Equal

Values must be Equatable, Comparable or derive from NSObject.

expect([1,2,3]).to(equal([1,2,3]))
expect("some string").toNot(equal("another string"))
expect(1) == 1
BeNil
expect(nil).to(beNil())
expect("some string").toNot(beNil())
BeTrue/BeFalse
expect(true).to(beTrue())
expect(false).to(beFalse())
BeGreaterThan/BeLessThan

Values must be Comparable.

expect(3).to(beGreaterThan(1))
expect(3) > 1

expect(1).to(beLessThan(3))
expect(1) < 3
BeGreaterThanOrEqualTo/BeLessThanOrEqualTo

Values must be Comparable.

expect(3).to(beGreaterThanOrEqualTo(1))
expect(3) >= 1
expect(1) >= 1

expect(1).to(beLessThanOrEqualTo(3))
expect(1) <= 3
expect(1) <= 1
Collections/String matchers

Sleipnir supports some matchers on collections and strings:

Contain

Matches if an item is in the container. Supports Swift collections with Equatable elements, NSArrays, NSSets and Strings.

expect([1,2,3]).to(contain(1))
expect("some string").toNot(contain("another"))
BeginWith/EndWith

Matches if the container begins/ends with the specified element. Supports Swift collections with Equatable elements, NSArrays and Strings.

expect([1,2,3]).to(beginWith(1))
expect("some string").to(endWith("string"))
BeEmpty

Matches if a container is empty.

expect("").to(beEmpty())
expect([1,2,3]).toNot(beEmpty())

TODO

  • Ease of distribution (CocoaPods probably)
  • XCode templates
  • Shared examples support
  • should syntax support
  • asynchronous matchers (will, willNot, after)

Who uses Sleipnir

  • SGL - Swift Generic Library

Contributing

Please read the Contributor Guide.

License

Licensed under MIT license. See the LICENSE file for details.

Comments
  • beNil matcher and Optional

    beNil matcher and Optional

    I want to check that object is or not nil. expect does not support optional values.

    let object:Int?
    it("shold work") {
    expect(object).toNot(beNil())
    
    let object:Int?
    it("shold work") {
    expect(object).to(equal(object))
    

    I was trying to implement that matcher but did't manage to do that. :(

    opened by kostiakoval 2
  • Migrate to Swift 2.2, get almost everything to compile

    Migrate to Swift 2.2, get almost everything to compile

    Things in current PR:

    • [x] Migrate to Swift 2.2 syntax
    • [x] Comment out String matchers and tests - these require separate discussion and implementation
    • [x] Fix almost all warnings in library, sample and spec targets

    If, in future, project will be continued, several things need to be made:

    • [ ] Figure out why Sleipnir target is not compiling or not being able to run - _main.swift stuff
    • [ ] Rewrite String matchers to work with Swift 2.0, where String is no longer a SequenceType
    opened by DenTelezhkin 1
  • Fix Compile errors reported in #16

    Fix Compile errors reported in #16

    Public extensions of generic classes are apparently not supported in the version of Swift in XCode 6.1. So for now I've made them internal so others can at least compile.

    I can't run the tests because of #17. I'll submit another pull request with a new test runner.

    opened by michaelgwelch 1
  • Compiler error due to Swift language version

    Compiler error due to Swift language version

    ld: /<project-path>/Pods/Sleipnir/Sleipnir/iOS/Sleipnir.framework/Sleipnir(fat_horse.armv7.o) compiled with newer version of Swift language (0x02) than previous files (1.0) for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    I get this error when trying to run test target on either simulator or ios device with ios8. Newest Xcode 6: Version 6.0.1 (6A317)

    opened by testower 1
  • Should syntax implementation

    Should syntax implementation

    This pull-request allows to write specs in should style:

    it("should work") {
      actual.should.equal(expected)
      3.should.beGreaterThan(1)
    }
    

    It provides extensions for all basic types, NSObject and some ObjC collection types (NSSet, NSArray) with should variable. Each of the extension supports using all available matchers of Sleipnir.

    opened by atermenji 1
  • Specs invocation should shutdown with appropriate result

    Specs invocation should shutdown with appropriate result

    Currenty specs invocation always returns 0 to command line output, even when there are failed specs. This is wrong, failure number should be returned when some specs have not passed. This will allow CI servers to easily determine build errors.

    bug 
    opened by atermenji 0
  • can't  build sample

    can't build sample

    clone repo, open it in Xcode6 - Beta3 run Sample project.

    See this error -

    Write auxiliary files /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml
    content of file

    
      'version': 0,
      'case-sensitive': 'false',
      'roots': [
    

    Error log -

    CompileSwift normal x86_64 com.apple.xcode.tools.swift.compiler
        cd /Users/konstantin/Work/Pods/Sleipnir/Sample
        /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -target x86_64-apple-macosx10.9 -module-name Sample -O0 -sdk /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -g -module-cache-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/ModuleCache -I /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-culvdrsgyplqqigxrcfdyyeyowhl/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-caokpubdjvmkvecouzlittpanymp/Build/Products/Debug -c -j8 /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/LibrarySpec.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Book.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/main.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Library.swift -output-file-map /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Sample-OutputFileMap.json -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Sample.swiftmodule -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-generated-files.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-own-target-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-project-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug/include -Xcc -I/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources/x86_64 -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Sample-Swift.h
    
    /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml:4:13: error: Could not find closing ]!
      'roots': [
                ^
    <unknown>:0: error: invalid virtual filesystem overlay file '/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml'
    0  swift                    0x0000000100e9bde8 llvm::sys::PrintStackTrace(__sFILE*) + 40
    1  swift                    0x0000000100e9c2d4 SignalHandler(int) + 452
    2  libsystem_platform.dylib 0x00007fff925f65aa _sigtramp + 26
    3  libsystem_platform.dylib 0x00000001022de204 _sigtramp + 1875803252
    4  swift                    0x00000001004742c8 swift::CompilerInstance::setup(swift::CompilerInvocation const&) + 760
    5  swift                    0x000000010022ef4c frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 1820
    6  swift                    0x000000010022e81d main + 1533
    7  libdyld.dylib            0x00007fff8aaae5fd start + 1
    8  libdyld.dylib            0x0000000000000041 start + 1968511557
    Stack dump:
    0.  Program arguments: /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/LibrarySpec.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Book.swift -primary-file /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/main.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Library.swift -enable-objc-attr-requires-objc-module -target x86_64-apple-macosx10.9 -module-name Sample -sdk /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-culvdrsgyplqqigxrcfdyyeyowhl/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-caokpubdjvmkvecouzlittpanymp/Build/Products/Debug -g -module-cache-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/ModuleCache -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-generated-files.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-own-target-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-project-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug/include -Xcc -I/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources/x86_64 -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/main~partial.swiftdoc -O0 -emit-module-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/main~partial.swiftmodule -serialize-diagnostics-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/main.dia -emit-dependencies-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/main.d -o /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/main.o 
    <unknown>:0: error: unable to execute command: Segmentation fault: 11
    <unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
    /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml:4:13: error: Could not find closing ]!
      'roots': [
                ^
    <unknown>:0: error: invalid virtual filesystem overlay file '/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml'
    0  swift                    0x0000000104af3de8 llvm::sys::PrintStackTrace(__sFILE*) + 40
    1  swift                    0x0000000104af42d4 SignalHandler(int) + 452
    2  libsystem_platform.dylib 0x00007fff925f65aa _sigtramp + 26
    3  libsystem_platform.dylib 0x0000000105f36a00 _sigtramp + 1939080304
    4  swift                    0x00000001040cc2c8 swift::CompilerInstance::setup(swift::CompilerInvocation const&) + 760
    5  swift                    0x0000000103e86f4c frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 1820
    6  swift                    0x0000000103e8681d main + 1533
    7  libdyld.dylib            0x00007fff8aaae5fd start + 1
    8  libdyld.dylib            0x0000000000000041 start + 1968511557
    Stack dump:
    0.  Program arguments: /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/LibrarySpec.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Book.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/main.swift -primary-file /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Library.swift -enable-objc-attr-requires-objc-module -target x86_64-apple-macosx10.9 -module-name Sample -sdk /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-culvdrsgyplqqigxrcfdyyeyowhl/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-caokpubdjvmkvecouzlittpanymp/Build/Products/Debug -g -module-cache-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/ModuleCache -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-generated-files.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-own-target-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-project-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug/include -Xcc -I/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources/x86_64 -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Library~partial.swiftdoc -O0 -emit-module-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Library~partial.swiftmodule -serialize-diagnostics-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Library.dia -emit-dependencies-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Library.d -o /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Library.o 
    <unknown>:0: error: unable to execute command: Segmentation fault: 11
    <unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
    /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml:4:13: error: Could not find closing ]!
      'roots': [
                ^
    <unknown>:0: error: invalid virtual filesystem overlay file '/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml'
    0  swift                    0x000000010c325de8 llvm::sys::PrintStackTrace(__sFILE*) + 40
    1  swift                    0x000000010c3262d4 SignalHandler(int) + 452
    2  libsystem_platform.dylib 0x00007fff925f65aa _sigtramp + 26
    3  libsystem_platform.dylib 0x000000010d765a00 _sigtramp + 2065101936
    4  swift                    0x000000010b8fe2c8 swift::CompilerInstance::setup(swift::CompilerInvocation const&) + 760
    5  swift                    0x000000010b6b8f4c frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 1820
    6  swift                    0x000000010b6b881d main + 1533
    7  libdyld.dylib            0x00007fff8aaae5fd start + 1
    8  libdyld.dylib            0x0000000000000041 start + 1968511557
    Stack dump:
    0.  Program arguments: /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/LibrarySpec.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Book.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/main.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Library.swift -enable-objc-attr-requires-objc-module -target x86_64-apple-macosx10.9 -module-name Sample -sdk /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-culvdrsgyplqqigxrcfdyyeyowhl/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-caokpubdjvmkvecouzlittpanymp/Build/Products/Debug -g -module-cache-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/ModuleCache -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-generated-files.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-own-target-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-project-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug/include -Xcc -I/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources/x86_64 -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/LibrarySpec~partial.swiftdoc -O0 -emit-module-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/LibrarySpec~partial.swiftmodule -serialize-diagnostics-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/LibrarySpec.dia -emit-dependencies-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/LibrarySpec.d -o /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/LibrarySpec.o 
    <unknown>:0: error: unable to execute command: Segmentation fault: 11
    <unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
    /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml:4:13: error: Could not find closing ]!
      'roots': [
                ^
    <unknown>:0: error: invalid virtual filesystem overlay file '/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml'
    0  swift                    0x0000000105e3ede8 llvm::sys::PrintStackTrace(__sFILE*) + 40
    1  swift                    0x0000000105e3f2d4 SignalHandler(int) + 452
    2  libsystem_platform.dylib 0x00007fff925f65aa _sigtramp + 26
    3  libsystem_platform.dylib 0x0000000107280a00 _sigtramp + 1959306352
    4  swift                    0x00000001054172c8 swift::CompilerInstance::setup(swift::CompilerInvocation const&) + 760
    5  swift                    0x00000001051d1f4c frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 1820
    6  swift                    0x00000001051d181d main + 1533
    7  libdyld.dylib            0x00007fff8aaae5fd start + 1
    8  libdyld.dylib            0x0000000000000041 start + 1968511557
    Stack dump:
    0.  Program arguments: /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/LibrarySpec.swift -primary-file /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Book.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/main.swift /Users/konstantin/Work/Pods/Sleipnir/Sample/Sample/Library.swift -enable-objc-attr-requires-objc-module -target x86_64-apple-macosx10.9 -module-name Sample -sdk /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-culvdrsgyplqqigxrcfdyyeyowhl/Build/Products/Debug -F /Users/konstantin/Library/Developer/Xcode/DerivedData/Sleipnir-caokpubdjvmkvecouzlittpanymp/Build/Products/Debug -g -module-cache-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/ModuleCache -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-generated-files.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-own-target-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Sample-project-headers.hmap -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Products/Debug/include -Xcc -I/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources/x86_64 -Xcc -I/Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Book~partial.swiftdoc -O0 -emit-module-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Book~partial.swiftmodule -serialize-diagnostics-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Book.dia -emit-dependencies-path /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Book.d -o /Users/konstantin/Work/Pods/Sleipnir/DerivedData/Sleipnir/Build/Intermediates/Sample.build/Debug/Sample.build/Objects-normal/x86_64/Book.o 
    <unknown>:0: error: unable to execute command: Segmentation fault: 11
    <unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
    Command /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254
    
    opened by kostiakoval 0
  • Fix String related matchers

    Fix String related matchers

    In Swift 2.2 String is not SequenceType anymore. One should try to use String.CharacterView instead. E.g.

    public func endWith(item: String) -> EndWith<String.CharacterView, Character>
    
    bug 
    opened by atermenji 0
  • Fix SleipnirLoader to load spec files

    Fix SleipnirLoader to load spec files

    Usefull links from @AlexDenisov:

    • https://www.reddit.com/r/iOSProgramming/comments/46muyc/diy_load_a_private_framework_at_runtime_to_use/
    • https://gist.github.com/JohnCoates/94c25e19050ffa5ea981
    bug 
    opened by atermenji 0
  • Can't run Sample

    Can't run Sample

    Can someone check to make sure they can still run the Sample project?

    I've had no luck writing command line projects that reference a Swift framework and was told this is not supported in currently released XCode 6.1.

    I see the same issue with the Sleipnir project. Do others have the same problem? I see a runtime dyld error.

    dyld: Library not loaded: @rpath/libswiftCore.dylib
    
    opened by michaelgwelch 6
  • Can't compile any more

    Can't compile any more

    Can't add public extensions to generic types Array or Optional

    Found this related issue on stackoverflow.

    http://stackoverflow.com/questions/26387262/array-extension-called-from-other-module

    How are others working around this?

    I guess in my local copy I'll remove the public modifier and add some other helper methods.

    Here is one of the 4 compile errors regarding this:

    /Users/mgwelch/Documents/Projects/thirdparty/swiftz/sleipnir/Sleipnir/Sleipnir/Matchers/ShouldSyntax.swift:29:9: Extension of generic type 'Array<T>' from a different module cannot provide public declarations
    
    opened by ghost 2
Releases(v0.4.0)
A light-weight TDD / BDD framework for Objective-C & Cocoa

Specta A light-weight TDD / BDD framework for Objective-C. FEATURES An Objective-C RSpec-like BDD DSL Quick and easy set up Built on top of XCTest Exc

Specta / Expecta 2.3k Dec 20, 2022
TestKit has been upgraded to a full solution for implementing Behavior-Driven Development (BDD) in Swift iOS apps.

The easiest way to implement full BDD in your Swift iOS projects! Use plain English specs (Gherkin) to drive tests that include both UI automation and interacting with application data & state.

Daniel Hall 11 Sep 14, 2022
Simple BDD for iOS

Kiwi: Simple BDD for iOS Kiwi is a Behavior Driven Development library for iOS development. The goal is to provide a BDD library that is exquisitely s

Kiwi 4.1k Dec 22, 2022
A Matcher Framework for Swift and Objective-C

Nimble Use Nimble to express the expected outcomes of Swift or Objective-C expressions. Inspired by Cedar. // Swift expect(1 + 1).to(equal(2)) expect(

Quick 4.6k Dec 31, 2022
The Swift (and Objective-C) testing framework.

Quick is a behavior-driven development framework for Swift and Objective-C. Inspired by RSpec, Specta, and Ginkgo. // Swift import Quick import Nimbl

Quick 9.6k Dec 31, 2022
AutoMocker is a Swift framework that leverages the type system to let you easily create mocked instances of your data types.

AutoMocker Context AutoMocker is a Swift framework that leverages the type system to let you easily create mocked instances of your data types. Here's

Vincent Pradeilles 39 May 19, 2022
Boilerplate-free mocking framework for Swift!

Cuckoo Mock your Swift objects! Introduction Cuckoo was created due to lack of a proper Swift mocking framework. We built the DSL to be very similar t

Brightify 1.5k Dec 27, 2022
Mockit is a Tasty mocking framework for unit tests in Swift 5.0

Mockit Introduction Mockit is a Tasty mocking framework for unit tests in Swift 5.0. It's at an early stage of development, but its current features a

Syed Sabir Salman-Al-Musawi 118 Oct 17, 2022
A convenient mocking framework for Swift

// Mocking let bird = mock(Bird.self) // Stubbing given(bird.getName()).willReturn("Ryan") // Verification verify(bird.fly()).wasCalled() What is Mo

Bird Rides, Inc 545 Jan 5, 2023
A mocking framework for Swift

SwiftMock SwiftMock is a mocking framework for Swift 5.2. Notes on the history of this repo September 2015: first version of this framework November 2

Matthew Flint 257 Dec 14, 2022
Swift Framework for TestRail's API

QuizTrain ?? ?? QuizTrain is a framework created at Venmo allowing you to interact with TestRail's API using Swift. It supports iOS, macOS, tvOS, and

Venmo 18 Mar 17, 2022
Swift framework containing a set of helpful XCTest extensions for writing UI automation tests

AutoMate • AppBuddy • Templates • ModelGenie AutoMate AutoMate is a Swift framework containing a set of helpful XCTest extensions for writing UI autom

PGS Software 274 Dec 30, 2022
A simple and lightweight matching library for XCTest framework.

Match A simple and lightweight matching library for XCTest framework. Getting started Swift Package Manager You can add Match to your project by addin

Michał Tynior 6 Oct 23, 2022
Genything is a framework for random testing of a program properties.

Genything is a framework for random testing of a program properties. It provides way to random data based on simple and complex types.

Just Eat Takeaway.com 25 Jun 13, 2022
Switchboard - easy and super light weight A/B testing for your mobile iPhone or android app. This mobile A/B testing framework allows you with minimal servers to run large amounts of mobile users.

Switchboard - easy A/B testing for your mobile app What it does Switchboard is a simple way to remote control your mobile application even after you'v

Keepsafe 287 Nov 19, 2022
Remote configuration and A/B Testing framework for iOS

MSActiveConfig v1.0.1 Remote configuration and A/B Testing framework for iOS. Documentation available online. MSActiveConfig at a glance One of the bi

Elevate 78 Jan 13, 2021
AB testing framework for iOS

ABKit Split Testing for Swift. ABKit is a library for implementing a simple Split Test that: Doesn't require an HTTP client written in Pure Swift Inst

Recruit Marketing Partners Co.,Ltd 113 Nov 11, 2022
Keep It Functional - An iOS Functional Testing Framework

IMPORTANT! Even though KIF is used to test your UI, you need to add it to your Unit Test target, not your UI Test target. The magic of KIF is that it

KIF Framework 6.2k Dec 29, 2022
iOS UI Automation Test Framework

Deprecation: EarlGrey 1.0 is deprecated in favor of EarlGrey 2.0 which integrates it with XCUITest. Please look at the earlgrey2 branch. EarlGrey 1.0

Google 5.5k Dec 30, 2022