run.sh 951 B

123456789101112131415161718192021222324252627
  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. # Download alice29.txt
  7. wget https://raw.githubusercontent.com/google/brotli/master/tests/testdata/alice29.txt
  8. if [[ $2 == "--sgx" ]];then
  9. readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
  10. else
  11. readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
  12. fi
  13. readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
  14. if [[ $1 != "--aot" ]]; then
  15. echo "============> run brotli.wasm"
  16. cat alice29.txt | ${IWASM_CMD} brotli.wasm -c > alice29.txt.comp
  17. else
  18. echo "============> compile brotli.wasm to aot"
  19. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o brotli.aot brotli.wasm \
  20. || ${WAMRC_CMD} -o brotli.aot brotli.wasm
  21. echo "============> run brotli.aot"
  22. cat alice29.txt | ${IWASM_CMD} brotli.aot -c > alice29.txt.comp
  23. fi