Skip to content

[XCTestObservation] Add test bundle observation #81

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

Merged
merged 1 commit into from
Mar 25, 2016

Conversation

modocache
Copy link
Contributor

Apple XCTest defines more methods on its XCTestObservation than swift-corelibs-xctest does. Here we add two of these missing methods:

  • testBundleWillStart()
  • testBundleDidFinish()

The documentation for the two methods is taken from Apple XCTest's headers.

Apple XCTest defines more methods on its XCTestObservation than
swift-corelibs-xctest does. Here we add two of these missing methods:

- `testBundleWillStart()`
- `testBundleDidFinish()`

The documentation for the two methods is taken from Apple XCTest's
headers.
@modocache modocache force-pushed the observation-bundle branch from d1e6abf to 8d46300 Compare March 25, 2016 05:01
@mike-ferris
Copy link

@swift-ci please test

@mike-ferris
Copy link

I guess this maps reasonably. What does mainBundle return for a linux command line tool (or an OS X one, for that matter)?

@modocache
Copy link
Contributor Author

Hmm, the Linux CI failure is an unrelated failure in the Swift test suite--strange, since we --skip-test-swift for the build preset. Maybe that flag doesn't skip validation tests... I'll modify our preset such that we don't get blocked by intermittent failures in Swift proper.

As for command-line tool bundles:

  • On OS X, using Xcode 7.2's command-line tool project template, printing [NSBundle mainBundle] outputs: NSBundle </Users/bgesiak/Library/Developer/Xcode/DerivedData/BundleBundleOnTheWall-ewdkqrksmgkyedgcxaivcypxfoaq/Build/Products/Debug> (loaded)
  • On Linux, in a simple Swift executable linked with Foundation, NSBundle.mainBundle() returns a temporary bundle at a path like /tmp/tmpZtm9Of.

I'm not sure how similar these two are, but I also think improving the bundle behavior could be something we improve upon later. I consider the fact that the announcements are made with the same signature as Apple XCTest to be the main improvement here.

@mike-ferris
Copy link

Agreed.

@modocache
Copy link
Contributor Author

@mike-ferris-apple Great! Normally I'd ask you to kick off CI again, but I'm not entirely sure it's been fixed. I've tested this on Linux and OS X and it definitely works for me, so... merging! 😁

@modocache modocache merged commit 2037d73 into swiftlang:master Mar 25, 2016
@modocache modocache deleted the observation-bundle branch March 25, 2016 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants