Update Travis Tests to run platforms in parallel (#11256)
This commit is contained in:
committed by
Scott Lahteine
parent
e486326910
commit
c43793aa1e
37
buildroot/share/tests/start_tests
Executable file
37
buildroot/share/tests/start_tests
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
export PATH="$PATH:$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"
|
||||
export PATH="$PATH:./buildroot/bin"
|
||||
|
||||
# exit on first failure
|
||||
set -e
|
||||
|
||||
exec_test () {
|
||||
printf "\033[0;32m[Test $2] \033[0m$3... "
|
||||
if build_marlin_pio $1 "-e $2"; then
|
||||
printf "\033[0;32mPassed\033[0m\n"
|
||||
return 0
|
||||
else
|
||||
env_restore
|
||||
printf "\033[0;31mFailed!\033[0m\n"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
export -f exec_test
|
||||
|
||||
env_backup
|
||||
printf "Running \033[0;32m$2\033[0m Tests\n"
|
||||
if [ $2 = "ALL" ]; then
|
||||
dir_list=("$(dirname "${BASH_SOURCE[0]}")"/*)
|
||||
declare -a tests=(${dir_list[@]/*start_tests/})
|
||||
for f in "${tests[@]}"; do
|
||||
testenv=$(basename $f | cut -d"_" -f1)
|
||||
printf "Running \033[0;32m$f\033[0m Tests\n"
|
||||
exec_test $1 "$testenv --target clean" "Setup Build Environment"
|
||||
$f $1 $testenv
|
||||
done
|
||||
else
|
||||
exec_test $1 "$2 --target clean" "Setup Build Environment"
|
||||
$2_tests $1 $2
|
||||
fi
|
||||
printf "\033[0;32mAll tests completed successfully\033[0m\n"
|
||||
env_restore
|
Reference in New Issue
Block a user