Refactored build outside src

This commit is contained in:
Syrus 2018-12-09 18:47:34 -08:00
parent 35c9512569
commit e58963dd35
65 changed files with 73 additions and 66 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/target
**/*.rs.bk
/artifacts
.DS_Store

View File

@ -7,7 +7,7 @@ repository = "https://github.com/wasmerio/wasmer"
publish = true
description = "High-Performance WebAssembly JIT interpreter"
license = "MIT"
build = "src/build_spectests.rs"
build = "build/mod.rs"
include = [
"examples/**/*",
"src/**/*",

8
build/mod.rs Normal file
View File

@ -0,0 +1,8 @@
extern crate wabt;
// use emtests;
mod spectests;
fn main() {
spectests::build();
}

View File

@ -1,8 +1,6 @@
//! This file will run at build time to autogenerate Rust tests based on
//! WebAssembly spec tests. It will convert the files indicated in TESTS
//! from "/spectests/{MODULE}.wast" to "/src/spectests/{MODULE}.rs".
extern crate wabt;
use std::collections::HashMap;
use std::env;
use std::fs;
@ -12,7 +10,7 @@ use wabt::wasm2wat;
static ENV_VAR: &str = "WASM_GENERATE_SPECTESTS";
static BANNER: &str = "// Rust test file autogenerated with cargo build (src/build_spectests.rs).
static BANNER: &str = "// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.\n";
const TESTS: [&str; 60] = [
@ -620,7 +618,7 @@ fn wast_to_rust(wast_filepath: &str) -> (String, i32) {
(script_name, generator.command_no)
}
fn main() {
pub fn build() {
if env::var(ENV_VAR).unwrap_or("0".to_string()) != "1" {
return;
}

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/address.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/align.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/binary.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/block.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/br.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/br_if.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/br_table.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/break_drop.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/call.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/call_indirect.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/comments.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/const_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/conversions.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/custom.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/data.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/elem.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/endianness.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/exports.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/f32_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/f32_bitwise.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/f32_cmp.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/f64_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/f64_bitwise.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/f64_cmp.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/fac.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/float_exprs.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/float_literals.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/float_memory.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/float_misc.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/forward.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/func.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/func_ptrs.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/get_local.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/globals.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/i32_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/i64_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/if_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/int_exprs.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/int_literals.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/labels.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/left_to_right.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/loop_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/memory.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/memory_grow.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/memory_redundancy.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/memory_trap.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// The _common module is not autogenerated, as it provides common functions for the spectests

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/nop.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/return_.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/select.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/set_local.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/stack.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/start.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/store_retval.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/switch.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/tee_local.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/token.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/traps.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/typecheck.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/types.wast
#![allow(

View File

@ -1,4 +1,4 @@
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/unwind.wast
#![allow(