forked from bytecodealliance/jco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-tests.sh
executable file
·36 lines (29 loc) · 1.1 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
git clone https://github.com/bytecodealliance/wit-bindgen
cd wit-bindgen
cargo test -p wit-bindgen-cli --no-default-features -F rust -F c
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
# c versions override 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/flavorful.wit
cd ..
./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
rm -rf wit-bindgen
## wasi virt to generate composition case
git clone https://github.com/bytecodealliance/wasi-virt
cd wasi-virt
cargo test
cp tests/generated/env-allow.composed.wasm ../test/fixtures/
cd ..
rm -rf wasi-virt