From 8f21da1df333bdef7024266f6181ea7891bd3bea Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Mon, 11 Mar 2024 19:26:44 +0100 Subject: [PATCH] compiletest: Allow `only-unix` in test headers The header `ignore-unix` is already allowed. Also extend tests. --- src/tools/compiletest/src/header.rs | 1 + src/tools/compiletest/src/header/tests.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 69658222ff3eb..a512599f723b7 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -852,6 +852,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "only-sparc64", "only-stable", "only-thumb", + "only-unix", "only-wasm32", "only-wasm32-bare", "only-windows", diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 433f3e8b5559c..cf300fbe74feb 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -285,6 +285,7 @@ fn ignore_target() { assert!(check_ignore(&config, "//@ ignore-x86_64-unknown-linux-gnu")); assert!(check_ignore(&config, "//@ ignore-x86_64")); assert!(check_ignore(&config, "//@ ignore-linux")); + assert!(check_ignore(&config, "//@ ignore-unix")); assert!(check_ignore(&config, "//@ ignore-gnu")); assert!(check_ignore(&config, "//@ ignore-64bit")); @@ -300,6 +301,7 @@ fn only_target() { assert!(check_ignore(&config, "//@ only-x86")); assert!(check_ignore(&config, "//@ only-linux")); + assert!(check_ignore(&config, "//@ only-unix")); assert!(check_ignore(&config, "//@ only-msvc")); assert!(check_ignore(&config, "//@ only-32bit"));