diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..8c50098 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +3.1 diff --git a/Package.pins b/Package.pins new file mode 100644 index 0000000..5bb2558 --- /dev/null +++ b/Package.pins @@ -0,0 +1,18 @@ +{ + "autoPin": true, + "pins": [ + { + "package": "Nimble", + "reason": null, + "repositoryURL": "https://github.com/Quick/Nimble.git", + "version": "7.0.1" + }, + { + "package": "Quick", + "reason": null, + "repositoryURL": "https://github.com/Quick/Quick.git", + "version": "1.1.0" + } + ], + "version": 1 +} \ No newline at end of file diff --git a/Package.swift b/Package.swift index 54bace1..0509605 100644 --- a/Package.swift +++ b/Package.swift @@ -1,11 +1,9 @@ import PackageDescription let package = Package( - name: "QuickTest", - targets: [ - Target(name: "Spec", dependencies: [.Target(name: "SampleLibrary")]), - ], + name: "QuickOnLinuxExample", dependencies: [ - .Package(url: "https://github.com/briancroom/Quick.git", majorVersion: 0, minor: 9), + .Package(url: "https://github.com/Quick/Quick.git", majorVersion: 1, minor: 1), + .Package(url: "https://github.com/Quick/Nimble.git", majorVersion: 7), ] ) diff --git a/README.md b/README.md index 3ab6585..f81c01b 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,39 @@ This is a trivial example of writing BDD specs using [Quick](https://github.com/ ```shell $ swift build -Cloning Packages/Quick -Compiling Swift Module 'Quick' (14 sources) -Linking Library: .build/debug/Quick.a -Compiling Swift Module 'QuickTest' (2 sources) -Linking Executable: .build/debug/QuickTest +Fetching https://github.com/Quick/Quick.git +Fetching https://github.com/Quick/Nimble.git +Cloning https://github.com/Quick/Nimble.git +Resolving https://github.com/Quick/Nimble.git at 7.0.1 +Cloning https://github.com/Quick/Quick.git +Resolving https://github.com/Quick/Quick.git at 1.1.0 +Compile Swift Module 'Quick' (22 sources) +Compile Swift Module 'Nimble' (50 sources) +Compile Swift Module 'SampleLibrary' (1 sources) +Compile Swift Module 'SampleLibraryTests' (2 sources) +Linking ./.build/debug/QuickOnLinuxExamplePackageTests.xctest +Test Suite 'All tests' started at 04:52:48.418 +Test Suite 'debug.xctest' started at 04:52:48.442 +Test Suite 'XCTestCase' started at 04:52:48.442 +Test Case 'XCTestCase.the test suite, runs my `it` block' started at 04:52:48.443 +Test Case 'XCTestCase.the test suite, runs my `it` block' passed (0.002 seconds) +Test Case 'XCTestCase.the test suite, when running another example, should register errors' started at 04:52:48.446 +/home/osboxes/swift/QuickOnLinuxExample/Tests/SampleLibraryTests/MySpec.swift:13: error: XCTestCase.the test suite, when running another example, should register errors : failed - expected to equal <2>, got <1> -$ .build/debug/QuickTest -Test Case 'MySpec.the test suite, runs my `it` block' started. -Test Case 'MySpec.the test suite, runs my `it` block' passed (0.0 seconds). -Test Case 'MySpec.the test suite, when running another example, should register errors' started. -/home/osboxes/swift/QuickOnLinuxExample/Sources/MySpec.swift:13: error: MySpec.the test suite, when running another example, should register errors : Uh oh fail! -Test Case 'MySpec.the test suite, when running another example, should register errors' failed (0.0 seconds). -Executed 2 tests, with 1 failure (0 unexpected) in 0.0 (0.0) seconds -Total executed 2 tests, with 1 failure (0 unexpected) in 0.0 (0.0) seconds +Test Case 'XCTestCase.the test suite, when running another example, should register errors' failed (0.002 seconds) +Test Case 'XCTestCase.the test suite, additional matchers, should allow comparison' started at 04:52:48.448 +Test Case 'XCTestCase.the test suite, additional matchers, should allow comparison' passed (0.001 seconds) +Test Case 'XCTestCase.the test suite, additional matchers, should allow checking count' started at 04:52:48.450 +Test Case 'XCTestCase.the test suite, additional matchers, should allow checking count' passed (0.002 seconds) +Test Suite 'XCTestCase' failed at 04:52:48.452 + Executed 4 tests, with 1 failure (0 unexpected) in 0.007 (0.007) seconds +Test Suite 'XCTestCase' started at 04:52:48.453 +Test Case 'XCTestCase.foo, returns a nice greeting' started at 04:52:48.453 +Test Case 'XCTestCase.foo, returns a nice greeting' passed (0.001 seconds) +Test Suite 'XCTestCase' passed at 04:52:48.454 + Executed 1 test, with 0 failures (0 unexpected) in 0.001 (0.001) seconds +Test Suite 'debug.xctest' failed at 04:52:48.455 + Executed 5 tests, with 1 failure (0 unexpected) in 0.008 (0.008) seconds +Test Suite 'All tests' failed at 04:52:48.456 + Executed 5 tests, with 1 failure (0 unexpected) in 0.008 (0.008) seconds ``` diff --git a/Sources/Spec/main.swift b/Sources/Spec/main.swift deleted file mode 100644 index 5d476cb..0000000 --- a/Sources/Spec/main.swift +++ /dev/null @@ -1,6 +0,0 @@ -import Quick - -QCKMain([ - MySpec(), - SampleLibrarySpec(), -]) diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..14e1115 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,9 @@ +import XCTest +import Quick + +@testable import SampleLibraryTests + +QCKMain([ + MySpec.self, + SampleLibrarySpec.self, +]) diff --git a/Sources/Spec/MySpec.swift b/Tests/SampleLibraryTests/MySpec.swift similarity index 100% rename from Sources/Spec/MySpec.swift rename to Tests/SampleLibraryTests/MySpec.swift diff --git a/Sources/Spec/SampleLibrarySpec.swift b/Tests/SampleLibraryTests/SampleLibrarySpec.swift similarity index 100% rename from Sources/Spec/SampleLibrarySpec.swift rename to Tests/SampleLibraryTests/SampleLibrarySpec.swift