forked from bytecodealliance/jco
-
Notifications
You must be signed in to change notification settings - Fork 1
/
update-tests.sh
executable file
·41 lines (34 loc) · 1.28 KB
/
update-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -ex
cd submodules/wit-bindgen
# build tests
cargo test -p wit-bindgen-cli --no-default-features -F rust -F c
# copy over the Rust-based wit-bindgen tests to our repo
for t in target/runtime-tests/*/rust.wasm
do
name="$(basename $(dirname $t))"
echo "cp $t ../../test/fixtures/components/${name}.component.wasm"
cp $t ../../test/fixtures/components/${name}.component.wasm
done
# copy over the C-based wit-bindgen tests to our repo.
# the C versions always override the Rust versions
for t in target/runtime-tests/*/c-*/*.component.wasm
do
name="$(basename $(dirname $t))"
name=${name:2}
echo "cp $t ../../test/fixtures/components/${name}.component.wasm"
cp $t ../../test/fixtures/components/${name}.component.wasm
done
# copy flavorful wit case
cp tests/runtime/flavorful/world.wit ../../test/fixtures/wit/deps/flavorful/flavorful.wit
cd ../..
# convert the js test fixtures into a wasm component
./src/jco.js componentize \
test/fixtures/component-gen/import-fn.js \
--wit test/fixtures/component-gen/import-fn.wit \
-o test/fixtures/components/import-fn.component.wasm
## wasi virt to generate composition cases
cd submodules/wasi-virt
cargo test
cp tests/generated/env-allow.composed.wasm ../../test/fixtures/
cp tests/generated/stdio.composed.wasm ../../test/fixtures/