mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-04-24 14:52:14 +00:00
Travis maintenance (#240)
* Use GCC 8 for tests. * Don't require sudo * Use wabt 0.6
This commit is contained in:
parent
da0b96ac45
commit
50c7a615f3
11
.travis.yml
11
.travis.yml
@ -1,5 +1,4 @@
|
||||
dist: trusty
|
||||
sudo: required
|
||||
language: rust
|
||||
rust:
|
||||
- nightly
|
||||
@ -9,12 +8,12 @@ addons:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-6
|
||||
- g++-6
|
||||
- gcc-8
|
||||
- g++-8
|
||||
- cmake
|
||||
script:
|
||||
- export CC=/usr/bin/gcc-6
|
||||
- export CXX=/usr/bin/g++-6
|
||||
- export CC=/usr/bin/gcc-8
|
||||
- export CXX=/usr/bin/g++-8
|
||||
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo build --no-default-features; fi
|
||||
- cargo build --release --verbose
|
||||
- cargo test --release --verbose
|
||||
@ -32,3 +31,5 @@ env:
|
||||
global:
|
||||
- secure: o0FH3sDSvQPBgGku0QU86HrSCH7YUN+l6WD4jk2OKkb/OVaYHR/9zna9/v7V5cQarg7uo4s7T8xSd6HJD3B+yxl2t73uPD+sqgf3hWx1PSI9ARtg3YWhq/l+Bl79Mm3Bz9hW68wPHXrKa95bDu2oYX6o15jWIYEMT4BUrGJWqhAoADnVdDttBaqKEkCBl1dFpRBagFV0/0eLXya8b+/6T7Q7Y8ZtINOD54fw5iDqAIlcKEyTWNF96/ZMOTfachs58hEn/EAFKLRWnarrGl9+jK/g7fU5+2QivJw8qVidqJvTA9A6FhRzELcwbS+okx63ViZe/JRO/GeGo3QR/Q71ukneu62EQf608B12h/3SLMomTlhv0swIvcehcUDXxCkujFN1dm3b68Tun9kbfnDyoTSy5dOLd92zkjgXo2M8PGfwLLceZVUovnrE9e9Je/lji9O+9bpFbxBkvrXnK8jAAmNVdfmefY/qeDW2HDFcP9aqquXXQ20JQw1fnd/R5y9MC+IKcKxaRtKoioDpQXtxj6JA7YyBzrMnVcmtOxUzvplNYPif9BBFtuBNKUIW5h3lcoyDWesRgzt5MXsm8q+femBDhkxbb24RU8hd8j5heUNtblqgADQpssH0eNHqYgSHgwYRhuRgjByTMt6rf0Da/uANoGnBZQWbwLsW9h/GGN0=
|
||||
- RUSTFLAGS=--cfg=slow_assertions
|
||||
- CC=/usr/bin/gcc-8
|
||||
- CXX=/usr/bin/g++-8
|
||||
|
@ -9,5 +9,5 @@ homepage = "https://github.com/nikvolf/parity-wasm"
|
||||
description = "parity-wasm testsuite"
|
||||
|
||||
[dependencies]
|
||||
wabt = "0.2"
|
||||
wabt = "0.6"
|
||||
parity-wasm = { path = ".." }
|
||||
|
@ -1,23 +1,34 @@
|
||||
use wabt::script::{ScriptParser, Command, CommandKind};
|
||||
use parity_wasm::elements::{Module, deserialize_buffer};
|
||||
use parity_wasm::elements::{deserialize_buffer, Module};
|
||||
use wabt::script::{Command, CommandKind, ScriptParser};
|
||||
|
||||
fn read_file(filename: &str) -> String {
|
||||
use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
|
||||
let mut f = File::open(filename).expect("file not found");
|
||||
|
||||
let mut contents = String::new();
|
||||
f.read_to_string(&mut contents)
|
||||
.expect("something went wrong reading the file");
|
||||
|
||||
contents
|
||||
}
|
||||
|
||||
pub fn spec(path: &str) {
|
||||
let mut parser = ScriptParser::from_file(&format!("./testsuite/{}.wast", path)).expect("Can't read spec script");
|
||||
let mut parser = {
|
||||
let source = read_file(&format!("./testsuite/{}.wast", path));
|
||||
ScriptParser::<f32, f64>::from_str(&source).expect("Can't read spec script")
|
||||
};
|
||||
while let Some(Command { kind, line }) = parser.next().expect("Failed to iterate") {
|
||||
match kind {
|
||||
CommandKind::AssertMalformed { module, .. } =>
|
||||
{
|
||||
match deserialize_buffer::<Module>(
|
||||
&module.into_vec().expect("Invalid filename provided")
|
||||
) {
|
||||
CommandKind::AssertMalformed { module, .. } => {
|
||||
match deserialize_buffer::<Module>(&module.into_vec()) {
|
||||
Ok(_) => panic!("Expected invalid module definition, got some module!"),
|
||||
Err(e) => println!("assert_invalid at line {} - success ({:?})", line, e),
|
||||
}
|
||||
}
|
||||
CommandKind::Module { module, .. } => {
|
||||
match deserialize_buffer::<Module>(
|
||||
&module.into_vec().expect("Invalid filename provided")
|
||||
) {
|
||||
match deserialize_buffer::<Module>(&module.into_vec()) {
|
||||
Ok(_) => println!("module at line {} - parsed ok", line),
|
||||
Err(e) => panic!("Valid module reported error ({:?})", e),
|
||||
}
|
||||
@ -27,4 +38,4 @@ pub fn spec(path: &str) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user