Skip to content

Commit

Permalink
ci: Convert wast to JSON with WABT
Browse files Browse the repository at this point in the history
Adds simple script to convert WAST tests to JSON on CI instead of
relaying on JSON files being available in the wasm-spec repo.
  • Loading branch information
chfast committed Sep 2, 2020
1 parent f42d4dc commit 21f9a84
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,33 @@ commands:
default: 477

steps:
- run:
name: "Install WABT"
command: |
if type wast2json; then
wast2json --version
else
[[ $OSTYPE = darwin* ]] && os=macos || os=ubuntu
cd /usr/local
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.19/wabt-1.0.19-$os.tar.gz | sudo tar xz --strip 1
fi
- run:
name: "Download spectest files"
working_directory: ~/build
command: |
if [ ! -d wasm-spec ]; then
git clone https://github.com/wasmx/wasm-spec --branch w3c-1.0-jsontests-20200813 --depth 1
git clone https://github.com/wasmx/wasm-spec --branch w3c-1.0-jsontests-20200813 --depth 1 wasm-spec
mkdir json && cd json
find ../wasm-spec/test/core -name '*.wast' -exec wast2json {} \;
fi
- run:
name: "Run spectest<<#parameters.skip_validation>> (skip validation)<</parameters.skip_validation>>"
working_directory: ~/build
command: |
set +e
expected=" PASSED <<parameters.expected_passed>>, FAILED <<parameters.expected_failed>>, SKIPPED <<parameters.expected_skipped>>."
result=$(bin/fizzy-spectests <<#parameters.skip_validation>>--skip-validation<</parameters.skip_validation>> wasm-spec/test/core/json | tail -1)
result=$(bin/fizzy-spectests <<#parameters.skip_validation>>--skip-validation<</parameters.skip_validation>> json | tail -1)
echo $result
if [ "$expected" != "$result" ]; then exit 1; fi
Expand Down

0 comments on commit 21f9a84

Please sign in to comment.