Bruno Cunha
Bruno Cunha

Reputation: 1810

How do you reference testPlans using xcodegen?

I'm not managing to reference the testPlans created manually in the xcworkspace file after running xcodegen.

It always says:

"The flag -testPlan cannot be used since the scheme does not use test plans."

The documentation on GitHub doesn't help much, as it's not clear where to add these lines when the project also uses schemeTemplates and targetTemplates.

Has anyone managed to make testPlans work together with multiple test targets and multiple schemes, using xcodegen?

I tried adding the testPlan file in the project.yml in the

schemeTemplates -> MyAppSchemeTemplate -> test -> testPlans -> path -> UnitTestsFeatureAOnlyTestPlan.xctestplan

And I tried pretty much everything possible within the xcodegen project.yml file, but nothing matched the project.xcscheme that gets generated when doing the testPlan creation from Xcode (while doing a scheme conversion to testPlan)

Upvotes: 0

Views: 1182

Answers (1)

bvarga
bvarga

Reputation: 723

You do not need to add to the schemeTemplates. You can use the following syntax:

schemes:
  appTests:
    build:
      targets:
        appSnapshotTests: none
    test:
      testPlans:
        - path: appTests.xctestplan
          defaultPlan: true

Upvotes: 0

Related Questions