MobileNativeFoundation / rules_xcodeproj

Bazel rules for generating Xcode projects.
MIT License
505 stars 77 forks source link

Bug: test host in the run targets #2990

Closed CognitiveDisson closed 3 months ago

CognitiveDisson commented 3 months ago

Description

If a test target specifies a test host, then in the scheme for that test target, the test host must be included in the list of targets to be built for testing and not for run.

Reproduction steps

You can reproduce this bug in the example project. Screenshot 2024-04-04 at 15 39 38

Expected behavior

Test host builded only when you running tests.

rules_xcodeproj version

fca6cfba49a6f75917c2b8b0143263a7dea2d46b

Xcode version

15.1

Bazel version

7.1.0

rules_apple version

No response

rules_swift version

No response

Additional information

No response

brentleyjones commented 3 months ago

The test host isn't being added there because of the test, it's because of adjust_schemes_for_swiftui_previews. The test host is built without being listed in the scheme. When you change the example to have adjust_schemes_for_swiftui_previews = False, you'll see no test host in the scheme, but it still builds the test host when running tests.