Skip to content

when(condition:) to switch over building for running vs testing #6992

Open
@rauhul

Description

@rauhul

Description

I'd like to conditionally define a flag when building a test to allow me to interpose an implementation detail of my library from a test.

I think this would look like:

.target(
  name: "Foo",
  cSettings: [
    .define("TESTING", condition: .when(buildKind: .test)),
  ]),

Currently one has to use environment variable trickery to enable this sort of behavior which is very gross

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions