Skip to content

Commit

Permalink
chore: add mod.rs tests/specification file for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nerodesu017 committed Jan 8, 2025
1 parent e192a23 commit 9274b4c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/specification/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ mod test_errors;
enum Filter {
#[allow(dead_code)]
Include(FnF),
#[allow(dead_code)]
Exclude(FnF),
}

struct FnF {
#[allow(dead_code)]
files: Option<Vec<String>>,
#[allow(dead_code)]
folders: Option<Vec<String>>,
}

Expand All @@ -27,22 +30,26 @@ impl Default for FnF {
}
}

// #[ignore = "Globals cause a panic"]
#[ignore = "Globals cause a panic"]
#[test_log::test]
pub fn spec_tests() {
std::env::set_var("RUST_BACKTRACE", "full");
println!("{}", std::process::id());
#[allow(unused)]
let filters = Filter::Exclude(FnF {
folders: Some(vec!["proposals".to_string()]),
..Default::default()
});

// let only_these_tests: Vec<String> = vec![];

let paths = get_wast_files(Path::new("./tests/specification/testsuite/"), &filters)
.expect("Failed to find testsuite");
// let paths = get_wast_files(Path::new("./tests/specification/testsuite/"), &filters)
// .expect("Failed to find testsuite");

// let pb: PathBuf = "./tests/specification/testsuite/custom_conversions.wast".into();
// let pb: PathBuf = "./tests/specification/testsuite/custom_f64.wast".into();
// let paths = vec![pb];
let pb: PathBuf = "./tests/specification/testsuite/binary.wast".into();
let paths = vec![pb];

let mut successful_reports = 0;
let mut failed_reports = 0;
Expand Down Expand Up @@ -73,6 +80,7 @@ pub fn spec_tests() {
);
}

#[allow(dead_code)]
// See: https://stackoverflow.com/a/76820878
fn get_wast_files(
base_path: &Path,
Expand Down

0 comments on commit 9274b4c

Please sign in to comment.