Skip to content

Allow tests to be ignored conditionally #1049

Description

@brson

Right now we can ignore a test like

#[test]
#[ignore]
fn test() { /* do something */ }

But to ignore it only on windows you've got to do

#[test]
#[cfg(target_os = "win32")]
#[ignore]
fn test() { /* do nothing */ }

#[test]
#[cfg(target_os = "macos")]
#[cfg(target_os = "linux")]
fn test() { /* do something */ }

We should just be able to do this

#[test]
#[ignore(target_os = "win32")]
fn test() { /* do something */ }

Where the thing insider ignore() is just matched against all configuration items in the compilation environment

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)A-testsuiteArea: The testsuite used to check the correctness of rustcE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions