Skip to content

Commit 16e70f9

Browse files
authored
Add standalone cases (#3536)
1 parent 7f94d18 commit 16e70f9

129 files changed

Lines changed: 3880 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/standalone/bfs/bfs.wasm

10.8 KB
Binary file not shown.

tests/standalone/bfs/run.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
#
6+
7+
if [[ $2 == "--sgx" ]];then
8+
readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
9+
else
10+
readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
11+
fi
12+
readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
13+
14+
if [[ $1 != "--aot" ]]; then
15+
echo "============> run bfs.wasm"
16+
${IWASM_CMD} --heap-size=0 -f bfs bfs.wasm
17+
else
18+
echo "============> compile bfs.wasm to aot"
19+
[[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o bfs.aot bfs.wasm \
20+
|| ${WAMRC_CMD} -o bfs.aot bfs.wasm
21+
echo "============> run bfs.aot"
22+
${IWASM_CMD} --heap-size=0 -f bfs bfs.aot
23+
fi
24+
24.4 KB
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
#
6+
7+
if [[ $2 == "--sgx" ]];then
8+
readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
9+
else
10+
readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
11+
fi
12+
readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
13+
14+
if [[ $1 != "--aot" ]]; then
15+
echo "============> run binary_trees.wasm"
16+
${IWASM_CMD} binary_trees.wasm 14
17+
else
18+
echo "============> compile binary_trees.wasm to aot"
19+
[[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o binary_trees.aot binary_trees.wasm \
20+
|| ${WAMRC_CMD} -o binary_trees.aot binary_trees.wasm
21+
echo "============> run binary_trees.aot"
22+
${IWASM_CMD} binary_trees.aot 18
23+
fi
24+
35.3 KB
Binary file not shown.

tests/standalone/blake3/run.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
#
6+
7+
if [[ $2 == "--sgx" ]];then
8+
readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
9+
else
10+
readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
11+
fi
12+
readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
13+
14+
if [[ $1 != "--aot" ]]; then
15+
echo "============> run blake3.wasm"
16+
${IWASM_CMD} blake3.wasm
17+
else
18+
echo "============> compile blake3.wasm to aot"
19+
[[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o blake3.aot blake3.wasm \
20+
|| ${WAMRC_CMD} -o blake3.aot blake3.wasm
21+
echo "============> run blake3.aot"
22+
${IWASM_CMD} blake3.aot
23+
fi
689 KB
Binary file not shown.

tests/standalone/brotli/run.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
#
6+
7+
# Download alice29.txt
8+
wget https://raw.githubusercontent.com/google/brotli/master/tests/testdata/alice29.txt
9+
10+
if [[ $2 == "--sgx" ]];then
11+
readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
12+
else
13+
readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
14+
fi
15+
readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
16+
17+
if [[ $1 != "--aot" ]]; then
18+
echo "============> run brotli.wasm"
19+
cat alice29.txt | ${IWASM_CMD} brotli.wasm -c > alice29.txt.comp
20+
else
21+
echo "============> compile brotli.wasm to aot"
22+
[[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o brotli.aot brotli.wasm \
23+
|| ${WAMRC_CMD} -o brotli.aot brotli.wasm
24+
echo "============> run brotli.aot"
25+
cat alice29.txt | ${IWASM_CMD} brotli.aot -c > alice29.txt.comp
26+
fi
27+

tests/standalone/c-ray/c_ray.wasm

87.8 KB
Binary file not shown.

tests/standalone/c-ray/run.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
#
6+
7+
if [[ $2 == "--sgx" ]];then
8+
readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
9+
else
10+
readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
11+
fi
12+
readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
13+
14+
if [[ $1 != "--aot" ]]; then
15+
echo "============> run c_ray.wasm"
16+
cat scene | ${IWASM_CMD} c_ray.wasm -s 1024x768 > foo.ppm
17+
else
18+
echo "============> compile c_ray.wasm to aot"
19+
[[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o c_ray.aot c_ray.wasm \
20+
|| ${WAMRC_CMD} -o c_ray.aot c_ray.wasm
21+
echo "============> run c_ray.aot"
22+
cat scene | ${IWASM_CMD} c_ray.aot -s 1024x768 > foo.ppm
23+
fi

0 commit comments

Comments
 (0)