My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

start_tests 1.1KB

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