More complete check script

Added options to check scrit:
test of boolean pass, deadcode, tomato
added caml compilation test
This commit is contained in:
Gwenal Delaval 2011-03-10 23:28:44 +01:00
parent 4e267d82c6
commit eb164f4268

View file

@ -21,8 +21,12 @@ CC="gcc -std=c99"
# par defaut : pas de test de generation de code
caml=0
java=0
lustre=0
c=0
minils=0
vhdl=0
score=0
max=0
@ -93,7 +97,8 @@ launch_check () {
done
echo
echo "Tests goods"
for f in ../good/*.ept ../image_filters/*.ept; do
pushd good > /dev/null
for f in *.ept; do
echec=0
if [ $verbose = 0 ]; then
echo -n "."
@ -114,24 +119,32 @@ launch_check () {
fi
fi
# Compil. java ?
#if [[ ($echec == 0) && ($java == 1) ]]; then
# pushd "${base_f}_java" > /dev/null
# for java_file in *.java ; do
# if $JAVAC -warn:-unused -sourcepath .:..:../t1 ${java_file} > /dev/null
# then
# echec=0
# else
# echec=3
# fi
# done
# popd > /dev/null
#fi
if [[ ($echec == 0) && ($java == 1) ]]; then
pushd "${base_f}" > /dev/null
for java_file in *.java ; do
if $JAVAC -warn:-unused -sourcepath .:..:../t1 ${java_file} > /dev/null
then
echec=0
else
echec=3
fi
done
popd > /dev/null
fi
# Compil. caml ?
if [[ ($echec == 0) && ($caml == 1) ]]; then
if $CAMLC -c ${base_f}.ml > /dev/null; then
echec=0
else
echec=4
fi
fi
# Compil. c ?
if [[ ($echec == 0) && ($c == 1) ]]; then
pushd ${base_f}_c >/dev/null
for cf in *.c; do
if $CC -c $cf >/dev/null 2>&1; then
echec=0
if $CC -I ../t1_c -c $cf >/dev/null 2>&1; then
echec=$echec
else
echec=5
fi
@ -160,6 +173,18 @@ launch_check () {
fi
popd >/dev/null
fi
# Compil. VHDL ?
if [[ ($echec == 0) && ($vhdl == 1) ]]; then
pushd ${base_f}_vhdl > /dev/null
for vhdl_file in *.vhd; do
if $VHDLC -a ${vhdl_file} && $VHDLC -e ${vhdl_file} > /dev/null 2>&1
then
echec=${echec}
else
echec=8
fi
done
fi
if [[ $echec == 0 ]]; then
score=`expr $score + 1`;
@ -169,8 +194,12 @@ launch_check () {
case $echec in
1 )
echo "Compilation failed.";;
2 )
echo "Compilation to Minils failed.";;
3 )
echo "Java compilation failed.";;
echo "Compilation to Java failed.";;
4 )
echo "Compilation to Caml failed.";;
5 )
echo "C compilation failed.";;
6 )
@ -180,6 +209,7 @@ launch_check () {
esac
fi
done
popd > /dev/null
echo
percent=`expr 100 \* $score / $max`;
@ -200,6 +230,16 @@ activate_java () {
coption="$coption -target java"
}
activate_caml () {
caml=1
coption="$coption -target caml"
}
activate_vhdl () {
vhdl=1
coption="$coption -target vhdl"
}
activate_c () {
c=1
coption="$coption -target c"
@ -210,6 +250,26 @@ activate_all () {
activate_c
}
activate_tomato () {
coption="$coption -tomato"
}
activate_cse () {
coption="$coption -cse"
}
activate_inter () {
coption="$coption -inter"
}
activate_boolean () {
coption="$coption -bool"
}
activate_deadcode () {
coption="$coption -deadcode"
}
# -1, -2, -3, -v1, -v2, -v3 kept for backward compatibility
# (to be suppressed)
while [ $# -gt 0 ]; do
@ -229,14 +289,43 @@ while [ $# -gt 0 ]; do
"-c" )
activate_c
shift;;
"-caml" )
activate_caml
shift;;
"-vhdl" )
activate_vhdl
shift;;
"-mls" )
activate_minils
shift;;
"-tomato" )
activate_tomato
shift;;
"-cse" )
activate_cse
shift;;
"-inter" )
activate_inter
shift;;
"-bool" )
activate_boolean
shift;;
"-deadcode" )
activate_deadcode
shift;;
"-h" )
echo "usage : $0 <options> <compilo>"
echo "options : "
echo "-clean : clean build dir"
echo "-java : test of code generation (java code)"
echo "-caml : test of code generation (caml code)"
echo "-lustre : test of code generation (lustre code)"
echo "-vhdl : test of code generation (vhdl)"
echo "-bool : test of boolean translation"
echo "-deadcode : test of deadcode removal"
echo "-inter : test of intermediate equations removal"
echo "-tomato : test of automata minimization"
echo "-cse : test of common sub-expression elimination"
echo "-c : test of code generation (c code)"
echo "-all : test all"
echo "-v : verbose"