iljawascoding
iljawascoding

Reputation: 1110

Xcode: Run tests twice with different options

I wrote my own ORM framework (something along the lines of CoreData or Realm), and also wrote quite a few tests in Xcode for it.

Now I want to introduce an additional encoding format used for storing data on disk, but I also want to keep supporting the original encoding format.

Is there a good strategy to run my all my existing -test* methods for both encoding formats without duplicating the existing test code?

Upvotes: 2

Views: 295

Answers (1)

mpw
mpw

Reputation: 99

The easiest way I have found is to just create a new test target and add all the same test classes to it. If you want them run in one go, create a target that has both of these test targets as dependencies (or just runs them manually).

How you parametrize for your different targets is up to you, we've successfully used two implementations of a category that has the definition that varies.

Upvotes: 1

Related Questions