Skip to content

Commit

Permalink
add runexamples.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Lelio-Brun committed Oct 22, 2019
1 parent 7796b1f commit 7da8af8
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
*.n.lus
*.obc
*.s
*.light.c
*.sn.lus
*.stc
*.bkp
*.wcet
*.epci
*.mls
*_c
.sh
*.sh
*.h
39 changes: 39 additions & 0 deletions examples/runexamples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

cd $(dirname $0)

VELUS="${VELUS} ${VELUSARGS}"

red=$(tput setaf 1)
green=$(tput setaf 2)
normal=$(tput sgr0)

OK=0
OK_FAILURE=0
OK_SUCCESS=0

S=0
for f in *.lus
do
if [ "${#f}" -gt "$S" ]; then
S=${#f}
fi
done

for f in *.lus
do
printf "%-${S}s" "$f"
OK=$(( OK + 1 ))
if $VELUS "$f" >/dev/null 2>/tmp/err; then
OK_SUCCESS=$(( OK_SUCCESS + 1 ))
CHECK="${green}OK${normal}"
else
OK_FAILURE=$(( OK_FAILURE + 1 ))
ERR=$(</tmp/err)
CHECK="${red}KO\n $ERR${normal}"
fi
printf " %b\n" "${CHECK}"
done

printf "\n"
printf -- "OK: ${green}%d${normal} / %d\n" "${OK_SUCCESS}" "${OK}"
11 changes: 11 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.n.lus
*.obc
*.s
*.light.c
*.stc
*.bkp
*.wcet
*.epci
*.mls
*_c
*.h

0 comments on commit 7da8af8

Please sign in to comment.