Support XCTest under Xcode 6 Beta 2

This still works on Xcode 5, but please look at this closely before deciding whether to merge.