run.sh 1.1 KB

123456789101112131415161718192021222324252627282930
  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. if [[ $2 == "--sgx" ]];then
  7. readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
  8. else
  9. readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
  10. fi
  11. readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
  12. if [[ $1 != "--aot" ]]; then
  13. echo "============> run test_string.wasm"
  14. ${IWASM_CMD} test_string.wasm
  15. ${IWASM_CMD} test_string_view.wasm
  16. else
  17. echo "============> compile test_string.wasm to aot"
  18. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o test_string.aot test_string.wasm \
  19. || ${WAMRC_CMD} -o test_string.aot test_string.wasm
  20. echo "============> compile test_string_view.wasm to aot"
  21. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o test_string_view.aot test_string_view.wasm \
  22. || ${WAMRC_CMD} -o test_string_view.aot test_string_view.wasm
  23. echo "============> run test_string.aot"
  24. ${IWASM_CMD} test_string.aot
  25. echo "============> run test_string_view.aot"
  26. ${IWASM_CMD} test_string_view.aot
  27. fi