"Run Test(s)"/"Run Test Class(es)"/"Run Test Bundle(s)" should use scheme for building before running

Originator:kbeitz
Number:rdar://25081897 Date Originated:2016 March 09
Status:Closed (Duplicate of 23567374) Resolved:Duplicate rdar://23567374
Product:Developer Tools Product Version:5, 6, 7
Classification: Reproducible:Always
 
"Run Test(s)"/"Run Test Class(es)"/"Run Test Bundle(s)" should use scheme for building before running

================

in a workspace containing project A & project B (and much more complex cases) where A depends upon B but B is not a subproject of A, and scheme M has been created to properly build B before A, attempting to run an individual test or a test class or an entire test bundle from the test navigator or the test "buttons" in the source will result in failure due to missing headers or missing products … where if the developer first performs Cmd-U through the point of "Build Succeeded" without running the entire test bundle and then choosing an individual test, the test will not fail.

choosing individual items should not rely solely on the existing test-bundle target and its stated dependencies, but should rather rely on the current scheme (since the test bundle could be a part of several different schemes designed to shard test-suites).

================


1. create project B in workspace W
2. add project A in workspace W
3. make project A dependent upon the product (and possibly headers) of B
4. create a scheme S in the workspace that dos not find implicit dependencies, does not parallelize the build, and builds B properly before A
5. clean the work space and DO NOT BUILD
6. attempt to individually run one of the tests, test-classes, or the entire test-bundle of A (where the creation of the tests depends upon A being able to be properly built) … and DO NOT USE Cmd-U or choose "Test" from the Product menu, but rather use the context menu in the Test navigator, or one of the test-"buttons" in the editor

7. after noticing the failure, perform Cmd-U while being prepared to hit "STOP"/Cmd-. as soon as the "Build Succeeded" message appears, before any tests are run
8. when "Build Succeeded" appears, immediately stop the build/test operation
9. now repeat step 5

================

by the end of step 6, the scheme mentioned should have built all of the necessary items listed in the test action, and the individual tests should be able to be run as though all dependencies are fulfilled.

================

during step 6, compilation or linking will fail, and the tests cannot be run.

during steps 7-8, compilation & linking succeed
during step 9, the expected results finally occur

the developer should not be required to babysit steps 7 & 8 to perform step 6.

================

workspace containing app, supporting lib.a files, supporting .framework projects, and schemes building them in the necessary order.

================

Xcode Version: 5, 6 & 7
OS X Build version: 10.9, 10.10, 10.11

================

we have a large project with a lot of dependencies.  our graph is pretty straightforward, but it becomes much less so if we are forced to make a tree of subprojects to do this work.  further, the test bundle targets often depend upon other projects/bundles in order to be built & run.  it should be possible to count on the current scheme to do automatically what we now have to work around manually to accomplish.

Comments

discovered that Cmd-Shift-U can replace step 7, but still …


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!