test: run _demo/* and _pydemo/*

This commit is contained in:
Li Jie
2024-06-08 10:15:18 +08:00
parent 91e1fa6aff
commit ee848e66ac
3 changed files with 63 additions and 52 deletions

26
.github/workflows/test_demo.sh vendored Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# llgo run subdirectories under _demo and _pydemo
total=0
failed=0
failed_cases=""
for d in ./_demo/* ./_pydemo/*; do
total=$((total+1))
if [ -d "$d" ]; then
echo "Testing $d"
if ! llgo run -v "$d"; then
echo "FAIL"
failed=$((failed+1))
failed_cases="$failed_cases\n$d"
else
echo "PASS"
fi
fi
done
echo "=== Done"
echo "$((total-failed))/$total tests passed"
if [ "$failed" -ne 0 ]; then
echo -e "Failed cases:$failed_cases"
exit 1
fi