How to test package traits?

Playing around with the new package traits feature, and it's almost great, but I'm running into one problem: I can't find a way to unit test non-default traits. Ideally, I'd like to do something like:

// swift-tools-version:6.1

import PackageDescription

let package = Package(
    name: "MyPackage",
    products: [
        .library(
            name: "MyPackage",
            targets: ["MyTarget"]
        ),
    ],
    traits: [
        "SomeTrait"
    ],
    targets: [
        .target(
            name: "MyTarget"
        ),
        .testTarget(
            name: "NoTraitTests",
            dependencies: ["MyTarget"],
            traits: []
        ),
        .testTarget(
            name: "WithSomeTraitTests",
            dependencies: ["MyTarget"],
            traits: ["SomeTrait"]
        )
    ]
)

What I'd like for this to do would be to compile the project twice; once with the trait enabled and once without, and run the unit tests in both configurations, to make sure both configurations work properly.

I do know about swift test --traits SomeTrait, but this seems to be all-in one way or another; I don't see a way to test both with one command. Furthermore, this option doesn't seem to be available at all when editing a package in Xcode's UI; I can't find any way to add arguments to the swift test command it uses under the hood, and somewhat strangely, whether it enables the trait or not appears to be somewhat random. It's usually off, but sometimes it just compiles with the trait enabled, and I'm not sure why.

Are there any tricks that I'm missing?

Thanks for the feedback.

This was something that we called out as a future direction. I think it would be great to have a swift build/test --all-trait-combinations that uses all possible permutations. Right now you are correct that you have to manually spell out the different swift build/test invocations.

Since Xcode is out of scope of the Swift project and an Apple provided tool, do you mind filing a feedback to such a feature?