From 4db11b610ebc70d838404b1ae44c09f161b9c7af Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 3 Dec 2018 15:18:23 -0800 Subject: [PATCH] Generalize to better support the spec proposals tests. --- lib/wast/build.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/wast/build.rs b/lib/wast/build.rs index ed3b12f72a..964fe4ab7e 100644 --- a/lib/wast/build.rs +++ b/lib/wast/build.rs @@ -1,7 +1,7 @@ use std::env; use std::fs::{read_dir, File}; use std::io::{self, Write}; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; fn main() { let out_dir = @@ -37,7 +37,16 @@ fn test_directory(out: &mut File, testsuite: &str) -> io::Result<()> { dir_entries.sort_by_key(|dir| dir.path()); - writeln!(out, "mod {} {{", testsuite)?; + writeln!( + out, + "mod {} {{", + Path::new(testsuite) + .file_stem() + .unwrap() + .to_str() + .unwrap() + .replace("-", "_") + )?; writeln!(out, " use super::{{native_isa, wast_file, Path}};")?; for dir_entry in dir_entries { let path = dir_entry.path();