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