3

I'm new to subclassing XCTestCase on multiple levels, but was curious to trying it out since it could potentially save me lots of time rewriting tests, so I set up a simple hierarchy of classes in my testing target:

BaseSpriteNodeTests : XCTestCase
 -> CharacterTests : BaseSpriteNodeTests
 -> -> EnemyTests : CharacterTests
 -> -> PlayerTests : CharacterTests

I gave BaseSpriteNodeTests two simple test methods: testCreation and testDestroy, to see the how inheritance is handled inside test targets.

When I Cmd+U all the tests, the console output is expected. (4 total classes, two methods each, 8 tests total)

Test Suite 'All tests' passed at 2015-09-21 09:43:46.396.
     Executed 8 tests, with 0 failures (0 unexpected) in 0.217 (0.225) seconds

However, the Test Navigator is only showing 7 tests:

Test Navigator

Is this a bug in Xcode, or am I missing something crucial about subclassing XCTestCase subclasses?

Andrew T.
  • 2,088
  • 1
  • 20
  • 42

1 Answers1

0

See my answer here - try deleting DerivedData.

I believe this is indeed an Xcode bug. Test Navigator, like a few other Xcode features, has a tendency to fall out of step with reality as changes are made. The only way to recover is to force a rebuild of the relevant index files/memory.

Community
  • 1
  • 1
aednichols
  • 2,292
  • 2
  • 19
  • 28