2016-09-24 04:11:06 -07:00
|
|
|
#!/bin/bash
|
2017-04-25 07:18:44 -07:00
|
|
|
|
2017-08-07 03:41:00 -07:00
|
|
|
MICROPYTHON=../build/unix/micropython
|
2018-02-09 04:41:31 -08:00
|
|
|
PYOPT=1
|
2017-04-25 07:18:44 -07:00
|
|
|
|
2016-09-24 04:11:06 -07:00
|
|
|
results=()
|
2016-10-03 07:32:58 -07:00
|
|
|
error=0
|
2017-04-25 07:18:44 -07:00
|
|
|
|
2016-11-05 17:49:55 -07:00
|
|
|
if [ -z "$*" ]; then
|
2016-10-04 09:53:32 -07:00
|
|
|
list="test_*.py"
|
|
|
|
else
|
2016-11-05 17:49:55 -07:00
|
|
|
list="$*"
|
2016-10-04 09:53:32 -07:00
|
|
|
fi
|
2017-04-25 07:18:44 -07:00
|
|
|
|
2016-10-04 09:53:32 -07:00
|
|
|
for i in $list; do
|
2017-04-25 07:18:44 -07:00
|
|
|
echo
|
2018-02-09 04:41:31 -08:00
|
|
|
if $MICROPYTHON -O$PYOPT $i; then
|
2017-04-25 07:18:44 -07:00
|
|
|
results+=("OK $i")
|
2016-09-24 04:11:06 -07:00
|
|
|
else
|
2017-04-25 07:18:44 -07:00
|
|
|
results+=("FAIL $i")
|
|
|
|
error=1
|
2016-09-24 04:11:06 -07:00
|
|
|
fi
|
2016-04-12 09:09:23 -07:00
|
|
|
done
|
2017-04-25 07:18:44 -07:00
|
|
|
|
2016-09-24 04:11:06 -07:00
|
|
|
echo
|
|
|
|
echo 'Summary:'
|
|
|
|
printf '%s\n' "${results[@]}"
|
2018-01-31 06:51:13 -08:00
|
|
|
echo '-------------------'
|
|
|
|
if [ $error == 0 ]; then
|
|
|
|
echo 'ALL OK'
|
|
|
|
else
|
|
|
|
echo 'FAIL at least one error occurred'
|
|
|
|
fi
|
2016-10-03 07:32:58 -07:00
|
|
|
exit $error
|