Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests in Carthage project #607

Merged
merged 1 commit into from
Mar 20, 2020
Merged

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Mar 20, 2020

Add unit test targets and schemes into Carthage project of ObjCThemis. This makes it much easier to iterate on ObjCThemis since now you don't need to do a silly dance with pushing commits and pulling changes in order to just run your unit tests.

Now all you need to do is open ObjCThemis.xcodeproj, hack on ObjCThemis, then select "Test Themis (Swift 4/5, macOS/iOS)" scheme and press ⌘U. That's it. No Internet connection required (after carthage bootstrap to pull OpenSSL dependency).

Xcode screenshot

Alternatively, you can run the tests from command-line:

xcodebuild \
    -derivedDataPath DerivedData  \
    -project ObjCThemis.xcodeproj \
    -scheme "Test Themis (Swift 5, macOS)" \
    test

[...]

Test Suite 'Test Themis (Swift 5, macOS).xctest' passed at 2020-03-20 16:43:02.167.
	 Executed 45 tests, with 0 failures (0 unexpected) in 4.090 (4.131) seconds
Test Suite 'All tests' passed at 2020-03-20 16:43:02.169.
	 Executed 45 tests, with 0 failures (0 unexpected) in 4.090 (4.133) seconds
2020-03-20 16:43:02.436 xcodebuild[54596:907204] [MT] IDETestOperationsObserverDebug: 4.709 elapsed -- Testing started completed.
2020-03-20 16:43:02.436 xcodebuild[54596:907204] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2020-03-20 16:43:02.436 xcodebuild[54596:907204] [MT] IDETestOperationsObserverDebug: 4.709 sec, +4.709 sec -- end

Test session results, code coverage, and logs:
	themis/DerivedData/Logs/Test/Test-Test Themis (Swift 5, macOS)-2020.03.20_16-42-28-+0200.xcresult

** TEST SUCCEEDED **

The changes are all in Xcode XML stuff so you'd probably want to pull the branch to your machine and try it out.

Checklist

  • Change is covered by automated tests a
  • The coding guidelines are followed
  • Public API has proper documentation
  • Changelog is updated (maybe later, if we feel like it during the release)

a We did not have Carthage tests before so Bitrise does not test them. I'll look into it after this PR is merged. Can't do that in the PR itself because Bitrise.

Add unit test targets and schemes into Carthage project of ObjCThemis.
This makes it much easier to iterate on ObjCThemis since now you don't
need to do a silly dance with pushing commits and pulling changes in
order to just run your unit tests.

Now all you need to do is open ObjCThemis.xcodeproj, hack on ObjCThemis,
then select "Test Themis (Swift 4/5, macOS/iOS)" scheme and press ⌘U.
That's it. No Internet connection required (after "carthage bootstrap"
to pull OpenSSL dependency).

Alternatively, you can run the tests from command-line:

    xcodebuild \
        -derivedDataPath DerivedData  \
        -project ObjCThemis.xcodeproj \
        -scheme "Test Themis (Swift 5, macOS)" \
        test
@ilammy ilammy added tests Themis test suite M-Carthage Package manager: Carthage, Objective-C and Swift, iOS and macOS labels Mar 20, 2020
@ilammy ilammy requested a review from vixentael March 20, 2020 14:52
@ilammy ilammy requested a review from Lagovas as a code owner March 20, 2020 14:52
@vixentael
Copy link
Contributor

I typically switch Swift version in Xcode project target, so it makes a lot of sense to create separate targets

@ilammy ilammy merged commit 7b3bfb2 into cossacklabs:master Mar 20, 2020
@ilammy ilammy deleted the carthage-test branch March 20, 2020 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-Carthage Package manager: Carthage, Objective-C and Swift, iOS and macOS tests Themis test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants