You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

runtest.sh 2.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/bash
  2. # Copyright 2019 Huawei Technologies Co., Ltd
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # ============================================================================
  16. CURRPATH=$(cd $(dirname $0); pwd)
  17. cd ${CURRPATH}
  18. PROJECT_PATH=${CURRPATH}/../../..
  19. if [ $BUILD_PATH ];then
  20. echo "BUILD_PATH = $BUILD_PATH"
  21. else
  22. BUILD_PATH=${PROJECT_PATH}/build
  23. echo "BUILD_PATH = $BUILD_PATH"
  24. fi
  25. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${BUILD_PATH}/third_party/gtest/lib
  26. export PYTHONPATH=$PYTHONPATH:${PROJECT_PATH}:${PROJECT_PATH}/tests/ut/cpp/python_input:${PROJECT_PATH}/tests/ut/python
  27. echo "export PYTHONPATH=$PYTHONPATH"
  28. IGNORE_EXEC=""
  29. if [ "x${ENABLE_GE}" == "xON" -o "x${ENABLE_GE}" == "xOn" -o "x${ENABLE_GE}" == "xon" -o \
  30. "x${ENABLE_GE}" == "xTrue" -o "x${ENABLE_GE}" == "xtrue" ]; then
  31. if [ $# -gt 0 ]; then
  32. IGNORE_EXEC="--ignore=$1/exec"
  33. else
  34. IGNORE_EXEC="--ignore=$CURRPATH/exec"
  35. fi
  36. fi
  37. if [ $# -gt 0 ]; then
  38. pytest -s --ignore=$1/pynative_mode --ignore=$1/parallel --ignore=$1/train $IGNORE_EXEC $1
  39. else
  40. pytest --ignore=$CURRPATH/pynative_mode --ignore=$CURRPATH/parallel --ignore=$CURRPATH/train $IGNORE_EXEC $CURRPATH
  41. fi
  42. RET=$?
  43. if [ "x${IGNORE_EXEC}" != "x" ]; then
  44. exit ${RET}
  45. fi
  46. if [ ${RET} -ne 0 ]; then
  47. exit ${RET}
  48. fi
  49. if [ $# -gt 0 ]; then
  50. pytest -n 4 --dist=loadfile -v $1/parallel $1/train
  51. else
  52. pytest -n 4 --dist=loadfile -v $CURRPATH/parallel $CURRPATH/train
  53. fi
  54. RET=$?
  55. if [ ${RET} -ne 0 ]; then
  56. exit ${RET}
  57. fi
  58. if [ $# -gt 0 ]; then
  59. pytest -s $1/pynative_mode
  60. else
  61. pytest $CURRPATH/pynative_mode
  62. fi
  63. RET=$?
  64. if [ ${RET} -ne 0 ]; then
  65. exit ${RET}
  66. fi