Skip to content

Commit 0885380

Browse files
committed
Use compiletest directives for properly only running wasm32-wasip1 tests on that target
1 parent 1dcbc23 commit 0885380

File tree

11 files changed

+15
-44
lines changed

11 files changed

+15
-44
lines changed

tests/run-make/wasm-abi/rmake.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1+
//@ only-wasm32-wasip1
2+
13
extern crate run_make_support;
24

35
use run_make_support::{rustc, tmp_dir};
46
use std::path::Path;
57
use std::process::Command;
68

79
fn main() {
8-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
9-
return;
10-
}
11-
1210
rustc().input("foo.rs").target("wasm32-wasip1").run();
1311

1412
let file = tmp_dir().join("foo.wasm");

tests/run-make/wasm-custom-section/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1+
//@ only-wasm32-wasip1
12
extern crate run_make_support;
23

34
use run_make_support::{rustc, tmp_dir, wasmparser};
45
use std::collections::HashMap;
56

67
fn main() {
7-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
8-
return;
9-
}
10-
118
rustc().input("foo.rs").target("wasm32-wasip1").run();
129
rustc().input("bar.rs").target("wasm32-wasip1").arg("-Clto").opt().run();
1310

tests/run-make/wasm-custom-sections-opt/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
//@ only-wasm32-wasip1
12
extern crate run_make_support;
23

34
use run_make_support::{tmp_dir, wasmparser, rustc};
45
use std::collections::HashMap;
56
use std::path::Path;
67

78
fn main() {
8-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
9-
return;
10-
}
11-
129
rustc().input("foo.rs").target("wasm32-wasip1").opt().run();
1310

1411
verify(&tmp_dir().join("foo.wasm"));

tests/run-make/wasm-export-all-symbols/rmake.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@ only-wasm32-wasip1
2+
13
extern crate run_make_support;
24

35
use run_make_support::{tmp_dir, wasmparser, rustc};
@@ -6,10 +8,6 @@ use std::path::Path;
68
use wasmparser::ExternalKind::*;
79

810
fn main() {
9-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
10-
return;
11-
}
12-
1311
test(&[]);
1412
test(&["-O"]);
1513
test(&["-Clto"]);

tests/run-make/wasm-import-module/rmake.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1+
//@ only-wasm32-wasip1
2+
13
extern crate run_make_support;
24

35
use run_make_support::{tmp_dir, wasmparser, rustc};
46
use std::collections::HashMap;
57
use wasmparser::TypeRef::Func;
68

79
fn main() {
8-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
9-
return;
10-
}
11-
1210
rustc().input("foo.rs").target("wasm32-wasip1").run();
1311
rustc()
1412
.input("bar.rs")

tests/run-make/wasm-panic-small/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
//@ only-wasm32-wasip1
12
#![deny(warnings)]
23

34
extern crate run_make_support;
45

56
use run_make_support::{rustc, tmp_dir};
67

78
fn main() {
8-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
9-
return;
10-
}
11-
129
test("a");
1310
test("b");
1411
test("c");

tests/run-make/wasm-spurious-import/rmake.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
//@ only-wasm32-wasip1
2+
13
extern crate run_make_support;
24

35
use run_make_support::{rustc, tmp_dir, wasmparser};
46
use std::collections::HashMap;
57

68
fn main() {
7-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
8-
return;
9-
}
10-
119
rustc()
1210
.input("main.rs")
1311
.target("wasm32-wasip1")

tests/run-make/wasm-stringify-ints-small/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
//@ only-wasm32-wasip1
12
#![deny(warnings)]
23

34
extern crate run_make_support;
45

56
use run_make_support::{rustc, tmp_dir};
67

78
fn main() {
8-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
9-
return;
10-
}
11-
129
rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").opt().run();
1310

1411
let bytes = std::fs::read(&tmp_dir().join("foo.wasm")).unwrap();

tests/run-make/wasm-symbols-different-module/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1+
//@ only-wasm32-wasip1
12
extern crate run_make_support;
23

34
use run_make_support::{rustc, tmp_dir, wasmparser};
45
use std::collections::{HashMap, HashSet};
56

67
fn main() {
7-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
8-
return;
9-
}
10-
118
test_file("foo.rs", &[("a", &["foo"]), ("b", &["foo"])]);
129
test_file("bar.rs", &[("m1", &["f", "g"]), ("m2", &["f"])]);
1310
test_file("baz.rs", &[("sqlite", &["allocate", "deallocate"])]);

tests/run-make/wasm-symbols-not-exported/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1+
//@ only-wasm32-wasip1
12
extern crate run_make_support;
23

34
use run_make_support::{rustc, tmp_dir, wasmparser};
45
use std::path::Path;
56

67
fn main() {
7-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
8-
return;
9-
}
10-
118
rustc().input("foo.rs").target("wasm32-wasip1").run();
129
verify_symbols(&tmp_dir().join("foo.wasm"));
1310
rustc().input("foo.rs").target("wasm32-wasip1").opt().run();

tests/run-make/wasm-symbols-not-imported/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1+
//@ only-wasm32-wasip1
12
extern crate run_make_support;
23

34
use run_make_support::{rustc, tmp_dir, wasmparser};
45
use std::path::Path;
56

67
fn main() {
7-
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
8-
return;
9-
}
10-
118
rustc().input("foo.rs").target("wasm32-wasip1").run();
129
verify_symbols(&tmp_dir().join("foo.wasm"));
1310
rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").run();

0 commit comments

Comments
 (0)