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

[ios] [carthage]unit tests do not run when Fuzzer's framework binary from carthage is linked to the test target #7

Open
dodikk opened this issue Mar 22, 2017 · 5 comments

Comments

@dodikk
Copy link
Contributor

dodikk commented Mar 22, 2017

Might be a bug of xcode. 

I'm getting the error below :

11:08:46.732 Xcode[2770:165018] DD23BA8F-6178-4475-973C-C4DAA7813BD0: Launched app with identifier: *****CENSORED****** (pid = 5976)
11:08:46.732 Xcode[2770:165018] Tracking pid 5976 for simulator <DVTiPhoneSimulator: 0x7fcaa80d5070> {
		SimDevice: SimDevice : iPhone SE (DD23BA8F-6178-4475-973C-C4DAA7813BD0) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-SE } runtime={ SimRuntime : 10.2 (14C89) - com.apple.CoreSimulator.SimRuntime.iOS-10-2 }
}
11:08:46.732 Xcode[2770:165018] Checking to see if pid 5976 is valid: kill(pid, 0) = 0 (YES, it's still running)
11:08:46.732 Xcode[2770:165018] Setting up DVTNotifyOnProcDeath for pid 5976
11:08:46.733 Xcode[2770:123883] Test process runnable PID is 5976.
11:08:49.528 Xcode[2770:123883] Launch session finished initial intensive file IO.
11:08:49.528 Xcode[2770:123883] Waiting for test process to check in..., will wait up to 120s
11:08:50.406 Xcode[2770:123883] Got death notice for pid 5976, removing from SimulatorSessionMap
11:08:50.444 Xcode[2770:123883] Launch session expired.
11:08:50.471 Xcode[2770:123883] Test operation failure: Launch session expired before checking in.
11:08:50.472 Xcode[2770:123883] _finishWithError:Error Domain=IDETestOperationsObserverErrorDomain Code=4 "Launch session expired before checking in." UserInfo={NSLocalizedDescription=Launch session expired before checking in.} didCancel: 1

The tests run properly when Fuzzer is added as a sub-project and built from source.

2-works

@dodikk
Copy link
Contributor Author

dodikk commented Mar 22, 2017

In my configuration the entire app is linked to the test target.
Unfortunately, I cannot change this for this particular project. Some users might face the same issue so I've put it down here.

@dodikk
Copy link
Contributor Author

dodikk commented Mar 22, 2017

We also need to check if the "binary from carthage" approach works for library tests.

In this case the test target has a dependency on

  • Fuzzer.framework dynamic iOS binary from Carthage
  • A library or a framework with the code to be tested

@dodikk dodikk changed the title [carthage] unit tests do not run when Fuzzer's framework binary from carthage is linked to the test target [ios] [carthage]unit tests do not run when Fuzzer's framework binary from carthage is linked to the test target Mar 22, 2017
@nikolaykasyanov
Copy link
Contributor

nikolaykasyanov commented Mar 18, 2018

I've just stumbled upon this and found something that might be a culprit.

$ otool -L Carthage/Build/iOS/Fuzzer.framework/Fuzzer
Carthage/Build/iOS/Fuzzer.framework/Fuzzer:
	/Library/Frameworks/Fuzzer.framework/Fuzzer (compatibility version 0.0.0, current version 0.0.0)
...
$ otool -L Carthage/Build/iOS/Cuckoo.framework/Cuckoo 
Carthage/Build/iOS/Cuckoo.framework/Cuckoo:
	@rpath/Cuckoo.framework/Cuckoo (compatibility version 1.0.0, current version 1.0.0)
...

Note that Fuzzer has an absolute install name, while Cuckoo (used just as an example of a Carthage-built framework that works) uses @rpath.

@nikolaykasyanov
Copy link
Contributor

@dodikk could you please check whether this PR fixes your issue?

@dodikk
Copy link
Contributor Author

dodikk commented Mar 19, 2018

@nikolaykasyanov , sure. I'll try these days.

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

No branches or pull requests

2 participants