My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

start_tests 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. export PATH="$PATH:$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"
  3. export PATH="$PATH:./buildroot/bin"
  4. # exit on first failure
  5. set -e
  6. exec_test () {
  7. printf "\033[0;32m[Test $2] \033[0m$3... "
  8. if build_marlin_pio $1 "-e $2"; then
  9. printf "\033[0;32mPassed\033[0m\n"
  10. return 0
  11. else
  12. env_restore
  13. printf "\033[0;31mFailed!\033[0m\n"
  14. return 1
  15. fi
  16. }
  17. export -f exec_test
  18. env_backup
  19. printf "Running \033[0;32m$2\033[0m Tests\n"
  20. if [[ $3 = "--deep-clean" ]]; then
  21. echo "Deleting all PlatformIO caches, downloads and installed packages..."
  22. env_clean --deep
  23. fi
  24. if [[ $2 = "ALL" ]]; then
  25. dir_list=("$(dirname "${BASH_SOURCE[0]}")"/*)
  26. declare -a tests=(${dir_list[@]/*start_tests/})
  27. for f in "${tests[@]}"; do
  28. testenv=$(basename $f | cut -d"_" -f1)
  29. printf "Running \033[0;32m$f\033[0m Tests\n"
  30. exec_test $1 "$testenv --target clean" "Setup Build Environment"
  31. $f $1 $testenv
  32. done
  33. else
  34. exec_test $1 "$2 --target clean" "Setup Build Environment"
  35. $2_tests $1 $2
  36. fi
  37. printf "\033[0;32mAll tests completed successfully\033[0m\n"
  38. env_restore