Skip to content

swift build --build-tests doesn't allow disabling tests with --skip or --filter #7953

Open
@finagolfin

Description

@finagolfin

Description

This is particularly useful when cross-compiling the test runner for a package, as I do for Android:

swift build --build-tests --enable-test-discovery --destination ~/swift-android-sdk/android-aarch64.json

The idea here is to be able to cross-compile the test runner and skip some tests: an alternative would be to add a --skip-run flag to swift test, so it builds but won't run the tests. (that alternative won't work, see next comment). @grynspan informs me that the new swift-testing tests can be filtered/skipped easily by passing these flags to the test runner, so this issue only deals with XCTest tests.

Expected behavior

Be able to skip or filter certain tests when cross-compiling the tests

Actual behavior

> ~/swift-DEVELOPMENT-SNAPSHOT-2022-09-24-a-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --filter Contended
error: Unknown option '--filter'

Steps to reproduce

  1. ~/swift-DEVELOPMENT-SNAPSHOT-2022-09-24-a-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --filter Contended

Swift Package Manager version/commit hash

5.7 and 5.8

Swift & OS version (output of swift --version && uname -a)

Never worked in Swift on Ubuntu 20.04 x86_64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions