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

Ensure compatible arch before launching on device #80

Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3c12080
WIP Failing lipo spec
jmoody Nov 17, 2014
74c30bf
Add michael and sam to travis email notifications
jmoody Nov 17, 2014
9177b08
WIP parse info from lipo output
svevang Nov 17, 2014
6c444f9
Remove un-need require in lipo.rb
jmoody Nov 18, 2014
d856321
No need to expose stdin from execute_lipo
jmoody Nov 18, 2014
1062aae
Lipo#info returns a list of arches
svevang Nov 18, 2014
8a842d0
Remove un-needed pry from lipo_spec.rb
svevang Nov 18, 2014
690f700
Use rspec expect syntax instead of should
jmoody Nov 18, 2014
4fdc3d0
Specs for Lipo#info successful path
jmoody Nov 18, 2014
1b7785c
Add FAT app bundle to rspec lipo_spec resources
jmoody Nov 18, 2014
a3c13b1
Updated class-level docs
jmoody Nov 26, 2014
dd85751
Add docs for + changed args of 'verify_arch'
jmoody Nov 26, 2014
b89ac96
Wildcard'ing unused arguments
jmoody Nov 26, 2014
3f75f00
Added simulator? and physical_device? to Device class
jmoody Nov 26, 2014
28df544
Simulator devices can report their instruction set
jmoody Nov 26, 2014
3418750
Merge branch 'develop' into feature/ensure-compatible-arch-before-lau…
jmoody Nov 26, 2014
dc29579
Isolate lipo binary resources; fixes flickering examples
jmoody Nov 26, 2014
543b911
[Whitespace] properly format 'skipping' device/Xcode combo
jmoody Nov 26, 2014
46e2e47
Remove trailing ; from line
jmoody Nov 26, 2014
60b7f6b
[Whitespace] Reformating to match style
jmoody Nov 26, 2014
8eab88a
Device instruction_set should be a string
jmoody Nov 26, 2014
f9f8fef
Instruction set should be a public method
jmoody Nov 26, 2014
b235772
Add documention to instruction_set method
jmoody Nov 26, 2014
4e658fe
Replace Lipo #verify with #ensure_compatible_arch
jmoody Nov 26, 2014
612ff83
Raise IncompatibleArchitecture error vs. RuntimeError
jmoody Nov 26, 2014
77c008c
Delay enabling accessibility until after merging options
jmoody Nov 26, 2014
46e38ec
Fixup expect_compatible_arch @raise docs
jmoody Nov 27, 2014
7e2a37e
Before launch do binary vs. sim arch compatibility check
jmoody Nov 27, 2014
267f307
Integration examples that test compatibility
jmoody Nov 27, 2014
0ca48c9
Doc :bundle_path attribute
jmoody Dec 1, 2014
1a91f7f
Whitespace - fix file indentation
jmoody Dec 1, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'develop' into feature/ensure-compatible-arch-before-lau…
…nching-on-device

Needed changes from develop to ensure passing rspec tests
on Xcode 6.2b and travis ci Xcode 6.1.1.

Also required behaviors from develop to complete task.

Conflicts:
	lib/run_loop/device.rb
jmoody committed Nov 26, 2014

Verified

This commit was signed with the committer’s verified signature. The key has expired.
nirinchev Nikola Irinchev
commit 341875080068c2fb8869cfedf776dbc715ea037c
22 changes: 22 additions & 0 deletions lib/run_loop/device.rb
Original file line number Diff line number Diff line change
@@ -17,6 +17,28 @@ def initialize(name, version, udid)
@udid = udid
end

# Returns and instruments-ready device identifier that is a suitable value
# for DEVICE_TARGET environment variable.
#
# @return [String] An instruments-ready device identifier.
# @raise [RuntimeError] If trying to obtain a instruments-ready identifier
# for a simulator when Xcode < 6.
def instruments_identifier(xcode_tools=RunLoop::XCTools.new)
if physical_device?
self.udid
else
unless xcode_tools.xcode_version_gte_6?
raise "Expected Xcode >= 6, but found version #{xcode_tools.version} - cannot create an identifier"
end
if self.version == RunLoop::Version.new('7.0.3')
version_part = self.version.to_s
else
version_part = "#{self.version.major}.#{self.version.minor}"
end
"#{self.name} (#{version_part} Simulator)"
end
end

# Is this a physical device?
# @return [Boolean] Returns true if this is a device.
def physical_device?
50 changes: 12 additions & 38 deletions spec/lib/device_spec.rb
Original file line number Diff line number Diff line change
@@ -27,28 +27,28 @@
end
end

describe '#simulator?' do
context '#simulator?' do
subject { device.simulator? }
context 'physical device' do
let(:device) { RunLoop::Device.new('name', '8.1.1', 'e60ef9ae876ab4a218ee966d0525c9fb79e5606d') }
it { is_expected.to be == false }
context 'is a simulator' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '77DA3AC3-EB3E-4B24-B899-4A20E315C318') }
it { is_expected.to be == true }
end

context 'simulator' do
let(:device) { RunLoop::Device.new('name', '8.1.1', 'not a device udid') }
it { is_expected.to be == true }
context 'is not a simulator' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '30c4b52a41d0f6c64a44bd01ff2966f03105de1e') }
it { is_expected.to be == false }
end
end

describe '#physical_device?' do
context '#device?' do
subject { device.physical_device? }
context 'physical device' do
let(:device) { RunLoop::Device.new('name', '8.1.1', 'e60ef9ae876ab4a218ee966d0525c9fb79e5606d') }
context 'is a physical device' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '30c4b52a41d0f6c64a44bd01ff2966f03105de1e') }
it { is_expected.to be == true }
end

context 'simulator' do
let(:device) { RunLoop::Device.new('name', '8.1.1', 'not a device udid') }
context 'is not a physical device' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '77DA3AC3-EB3E-4B24-B899-4A20E315C318') }
it { is_expected.to be == false }
end
end
@@ -82,32 +82,6 @@
end
end

context '#simulator?' do
subject { device.simulator? }
context 'is a simulator' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '77DA3AC3-EB3E-4B24-B899-4A20E315C318') }
it { is_expected.to be == true }
end

context 'is not a simulator' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '30c4b52a41d0f6c64a44bd01ff2966f03105de1e') }
it { is_expected.to be == false }
end
end

context '#device?' do
subject { device.physical_device? }
context 'is a physical device' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '30c4b52a41d0f6c64a44bd01ff2966f03105de1e') }
it { is_expected.to be == true }
end

context 'is not a physical device' do
let(:device) { RunLoop::Device.new('name', '7.1.2', '77DA3AC3-EB3E-4B24-B899-4A20E315C318') }
it { is_expected.to be == false }
end
end

describe '#instruction_set' do
describe 'is a physical device' do
it 'raises an error' do
You are viewing a condensed version of this merge commit. You can view the full changes here.