Skip to content

Commit

Permalink
ensure TEST_TARGET_NAME is set correctly for UI Test target
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-makarov committed Jul 6, 2020
1 parent e35dbfd commit e83fbd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/xcake/dsl/project/sugar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def ui_tests_for(host_target)
t.type = :ui_test_bundle
configure_test_target_for_host_target(t, host_target)

t.all_configurations.each do |c|
c.settings['TEST_TARGET_NAME'] = host_target.name
end

yield(t) if block_given?
end
end
Expand Down
7 changes: 7 additions & 0 deletions spec/project/sugar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ module Xcake
end
expect(@target.all_configurations).to all(runpath_set)
end

it 'should set TEST_TARGET_NAME to be host target' do
runpath_set = satisfy do |c|
c.settings['TEST_TARGET_NAME'] == @app_target.name
end
expect(@target.all_configurations).to all(runpath_set)
end
end

context 'when creating unit test target' do
Expand Down

0 comments on commit e83fbd0

Please sign in to comment.