Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use compiletest directives for properly only running wasm32-wasip1 te…
…sts on that target
  • Loading branch information
jieyouxu committed Mar 27, 2024
commit 08853804d059cb546137de6a89d8f05fc0193963
6 changes: 2 additions & 4 deletions tests/run-make/wasm-abi/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//@ only-wasm32-wasip1

extern crate run_make_support;

use run_make_support::{rustc, tmp_dir};
use std::path::Path;
use std::process::Command;

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc().input("foo.rs").target("wasm32-wasip1").run();

let file = tmp_dir().join("foo.wasm");
Expand Down
5 changes: 1 addition & 4 deletions tests/run-make/wasm-custom-section/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
//@ only-wasm32-wasip1
extern crate run_make_support;

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

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc().input("foo.rs").target("wasm32-wasip1").run();
rustc().input("bar.rs").target("wasm32-wasip1").arg("-Clto").opt().run();

Expand Down
5 changes: 1 addition & 4 deletions tests/run-make/wasm-custom-sections-opt/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
//@ only-wasm32-wasip1
extern crate run_make_support;

use run_make_support::{tmp_dir, wasmparser, rustc};
use std::collections::HashMap;
use std::path::Path;

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc().input("foo.rs").target("wasm32-wasip1").opt().run();

verify(&tmp_dir().join("foo.wasm"));
Expand Down
6 changes: 2 additions & 4 deletions tests/run-make/wasm-export-all-symbols/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//@ only-wasm32-wasip1

extern crate run_make_support;

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

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

test(&[]);
test(&["-O"]);
test(&["-Clto"]);
Expand Down
6 changes: 2 additions & 4 deletions tests/run-make/wasm-import-module/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//@ only-wasm32-wasip1

extern crate run_make_support;

use run_make_support::{tmp_dir, wasmparser, rustc};
use std::collections::HashMap;
use wasmparser::TypeRef::Func;

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc().input("foo.rs").target("wasm32-wasip1").run();
rustc()
.input("bar.rs")
Expand Down
5 changes: 1 addition & 4 deletions tests/run-make/wasm-panic-small/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
//@ only-wasm32-wasip1
#![deny(warnings)]

extern crate run_make_support;

use run_make_support::{rustc, tmp_dir};

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

test("a");
test("b");
test("c");
Expand Down
6 changes: 2 additions & 4 deletions tests/run-make/wasm-spurious-import/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
//@ only-wasm32-wasip1

extern crate run_make_support;

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

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc()
.input("main.rs")
.target("wasm32-wasip1")
Expand Down
5 changes: 1 addition & 4 deletions tests/run-make/wasm-stringify-ints-small/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
//@ only-wasm32-wasip1
#![deny(warnings)]

extern crate run_make_support;

use run_make_support::{rustc, tmp_dir};

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").opt().run();

let bytes = std::fs::read(&tmp_dir().join("foo.wasm")).unwrap();
Expand Down
5 changes: 1 addition & 4 deletions tests/run-make/wasm-symbols-different-module/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
//@ only-wasm32-wasip1
extern crate run_make_support;

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

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

test_file("foo.rs", &[("a", &["foo"]), ("b", &["foo"])]);
test_file("bar.rs", &[("m1", &["f", "g"]), ("m2", &["f"])]);
test_file("baz.rs", &[("sqlite", &["allocate", "deallocate"])]);
Expand Down
5 changes: 1 addition & 4 deletions tests/run-make/wasm-symbols-not-exported/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
//@ only-wasm32-wasip1
extern crate run_make_support;

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

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc().input("foo.rs").target("wasm32-wasip1").run();
verify_symbols(&tmp_dir().join("foo.wasm"));
rustc().input("foo.rs").target("wasm32-wasip1").opt().run();
Expand Down
5 changes: 1 addition & 4 deletions tests/run-make/wasm-symbols-not-imported/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
//@ only-wasm32-wasip1
extern crate run_make_support;

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

fn main() {
if std::env::var("TARGET").unwrap() != "wasm32-wasip1" {
return;
}

rustc().input("foo.rs").target("wasm32-wasip1").run();
verify_symbols(&tmp_dir().join("foo.wasm"));
rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").run();
Expand Down