Skip to content

Commit e300ded

Browse files
Add test for syntax errors
1 parent a5964e3 commit e300ded

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

scripts/tests/check_syntax.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
mydir=$(readlink -f "$0")
3+
mydir=$(dirname "$mydir")
4+
fs="$mydir"/../../internal_filesystem/
5+
cross="$mydir"/../../lvgl_micropython/lib/micropython/mpy-cross/build/mpy-cross
6+
7+
failed=0
8+
while read file; do
9+
"$cross" -march=x64 -o /dev/null "$file"
10+
exitcode="$?"
11+
if [ $exitcode -ne 0 ]; then
12+
echo "$file got exitcode $exitcode"
13+
failed=$(expr $failed \+ 1)
14+
fi
15+
done < <(find "$fs" -iname "*.py")
16+
17+
if [ $failed -ne 0 ]; then
18+
echo "ERROR: $failed .py files have syntax errors"
19+
exit 1
20+
fi

0 commit comments

Comments
 (0)