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_opensrc.sh 2.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. PROJECT_PATH=${CURRPATH}/../..
  18. if [ $BUILD_PATH ];then
  19. echo "BUILD_PATH = $BUILD_PATH"
  20. else
  21. BUILD_PATH=${PROJECT_PATH}/build
  22. echo "BUILD_PATH = $BUILD_PATH"
  23. fi
  24. cd ${BUILD_PATH}/mindspore/tests/ut
  25. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${BUILD_PATH}/third_party/gtest/lib
  26. export PYTHONPATH=$PYTHONPATH:${PROJECT_PATH}:${PROJECT_PATH}/tests/ut/python_input:${PROJECT_PATH}/tests/python
  27. echo "export PYTHONPATH=$PYTHONPATH:${PROJECT_PATH}:${PROJECT_PATH}/tests/ut/python_input"
  28. if [ $# -gt 0 ]; then
  29. pytest -s --ignore=$1/pynative_mode $1
  30. else
  31. pytest $CURRPATH/train $CURRPATH/infer $CURRPATH/model $CURRPATH/core $CURRPATH/adapter $CURRPATH/custom_ops $CURRPATH/data $CURRPATH/distributed $CURRPATH/nn $CURRPATH/exec $CURRPATH/optimizer --ignore=$CURRPATH/custom_ops/test_cus_conv2d.py --ignore=$CURRPATH/core/test_tensor.py --ignore=$CURRPATH/model/test_vgg.py --ignore=$CURRPATH/engine/test_training.py --ignore=$CURRPATH/nn/test_dense.py --ignore=$CURRPATH/nn/test_embedding.py --ignore=$CURRPATH/nn/test_conv.py --ignore=$CURRPATH/nn/test_activation.py --ignore=$CURRPATH/core/test_tensor_py.py
  32. fi
  33. RET=$?
  34. if [ ${RET} -ne 0 ]; then
  35. exit ${RET}
  36. fi
  37. if [ $# -gt 0 ]; then
  38. pytest -s $1/pynative_mode
  39. else
  40. pytest $CURRPATH/pynative_mode
  41. fi
  42. RET=$?
  43. if [ ${RET} -ne 0 ]; then
  44. exit ${RET}
  45. fi