Skip to content

Commit 7643db6

Browse files
committed
use ignore directives for run-make tests
This makes the tests easier to read, and makes it possible to tell which tests aren't being run on the host platform. Fixes #56704.
1 parent 325b7c6 commit 7643db6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/util.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
99
("androideabi", "android"),
1010
("bitrig", "bitrig"),
1111
("cloudabi", "cloudabi"),
12+
("cuda", "cuda"),
1213
("darwin", "macos"),
1314
("dragonfly", "dragonfly"),
1415
("emscripten", "emscripten"),
@@ -20,9 +21,11 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
2021
("l4re", "l4re"),
2122
("linux", "linux"),
2223
("mingw32", "windows"),
24+
("none", "none"),
2325
("netbsd", "netbsd"),
2426
("openbsd", "openbsd"),
2527
("redox", "redox"),
28+
("sgx", "sgx"),
2629
("solaris", "solaris"),
2730
("win32", "windows"),
2831
("windows", "windows"),
@@ -38,6 +41,7 @@ const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
3841
("armv7", "arm"),
3942
("armv7s", "arm"),
4043
("asmjs", "asmjs"),
44+
("cuda", "cuda"),
4145
("hexagon", "hexagon"),
4246
("i386", "x86"),
4347
("i586", "x86"),
@@ -154,6 +158,7 @@ fn test_get_arch_failure() {
154158
fn test_get_arch() {
155159
assert_eq!("x86_64", get_arch("x86_64-unknown-linux-gnu"));
156160
assert_eq!("x86_64", get_arch("amd64"));
161+
assert_eq!("cuda", get_arch("nvptx64-nvidia-cuda"));
157162
}
158163

159164
#[test]
@@ -168,4 +173,8 @@ fn test_matches_os() {
168173
assert!(matches_os("wasm32-unknown-unknown", "emscripten"));
169174
assert!(matches_os("wasm32-unknown-unknown", "wasm32-bare"));
170175
assert!(!matches_os("wasm32-unknown-unknown", "windows"));
176+
assert!(matches_os("thumbv6m0-none-eabi", "none"));
177+
assert!(matches_os("riscv32imc-unknown-none-elf", "none"));
178+
assert!(matches_os("nvptx64-nvidia-cuda", "cuda"));
179+
assert!(matches_os("x86_64-fortanix-unknown-sgx", "sgx"));
171180
}

0 commit comments

Comments
 (0)