More complete check script
Added options to check scrit: test of boolean pass, deadcode, tomato added caml compilation test
This commit is contained in:
parent
4e267d82c6
commit
eb164f4268
121
test/check
121
test/check
|
@ -21,8 +21,12 @@ CC="gcc -std=c99"
|
||||||
|
|
||||||
# par defaut : pas de test de generation de code
|
# par defaut : pas de test de generation de code
|
||||||
|
|
||||||
|
caml=0
|
||||||
java=0
|
java=0
|
||||||
|
lustre=0
|
||||||
c=0
|
c=0
|
||||||
|
minils=0
|
||||||
|
vhdl=0
|
||||||
|
|
||||||
score=0
|
score=0
|
||||||
max=0
|
max=0
|
||||||
|
@ -93,7 +97,8 @@ launch_check () {
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
echo "Tests goods"
|
echo "Tests goods"
|
||||||
for f in ../good/*.ept ../image_filters/*.ept; do
|
pushd good > /dev/null
|
||||||
|
for f in *.ept; do
|
||||||
echec=0
|
echec=0
|
||||||
if [ $verbose = 0 ]; then
|
if [ $verbose = 0 ]; then
|
||||||
echo -n "."
|
echo -n "."
|
||||||
|
@ -114,24 +119,32 @@ launch_check () {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# Compil. java ?
|
# Compil. java ?
|
||||||
#if [[ ($echec == 0) && ($java == 1) ]]; then
|
if [[ ($echec == 0) && ($java == 1) ]]; then
|
||||||
# pushd "${base_f}_java" > /dev/null
|
pushd "${base_f}" > /dev/null
|
||||||
# for java_file in *.java ; do
|
for java_file in *.java ; do
|
||||||
# if $JAVAC -warn:-unused -sourcepath .:..:../t1 ${java_file} > /dev/null
|
if $JAVAC -warn:-unused -sourcepath .:..:../t1 ${java_file} > /dev/null
|
||||||
# then
|
then
|
||||||
# echec=0
|
echec=0
|
||||||
# else
|
else
|
||||||
# echec=3
|
echec=3
|
||||||
# fi
|
fi
|
||||||
# done
|
done
|
||||||
# popd > /dev/null
|
popd > /dev/null
|
||||||
#fi
|
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 ?
|
# Compil. c ?
|
||||||
if [[ ($echec == 0) && ($c == 1) ]]; then
|
if [[ ($echec == 0) && ($c == 1) ]]; then
|
||||||
pushd ${base_f}_c >/dev/null
|
pushd ${base_f}_c >/dev/null
|
||||||
for cf in *.c; do
|
for cf in *.c; do
|
||||||
if $CC -c $cf >/dev/null 2>&1; then
|
if $CC -I ../t1_c -c $cf >/dev/null 2>&1; then
|
||||||
echec=0
|
echec=$echec
|
||||||
else
|
else
|
||||||
echec=5
|
echec=5
|
||||||
fi
|
fi
|
||||||
|
@ -160,6 +173,18 @@ launch_check () {
|
||||||
fi
|
fi
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
fi
|
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
|
if [[ $echec == 0 ]]; then
|
||||||
score=`expr $score + 1`;
|
score=`expr $score + 1`;
|
||||||
|
@ -169,8 +194,12 @@ launch_check () {
|
||||||
case $echec in
|
case $echec in
|
||||||
1 )
|
1 )
|
||||||
echo "Compilation failed.";;
|
echo "Compilation failed.";;
|
||||||
|
2 )
|
||||||
|
echo "Compilation to Minils failed.";;
|
||||||
3 )
|
3 )
|
||||||
echo "Java compilation failed.";;
|
echo "Compilation to Java failed.";;
|
||||||
|
4 )
|
||||||
|
echo "Compilation to Caml failed.";;
|
||||||
5 )
|
5 )
|
||||||
echo "C compilation failed.";;
|
echo "C compilation failed.";;
|
||||||
6 )
|
6 )
|
||||||
|
@ -180,6 +209,7 @@ launch_check () {
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
popd > /dev/null
|
||||||
echo
|
echo
|
||||||
|
|
||||||
percent=`expr 100 \* $score / $max`;
|
percent=`expr 100 \* $score / $max`;
|
||||||
|
@ -200,6 +230,16 @@ activate_java () {
|
||||||
coption="$coption -target java"
|
coption="$coption -target java"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activate_caml () {
|
||||||
|
caml=1
|
||||||
|
coption="$coption -target caml"
|
||||||
|
}
|
||||||
|
|
||||||
|
activate_vhdl () {
|
||||||
|
vhdl=1
|
||||||
|
coption="$coption -target vhdl"
|
||||||
|
}
|
||||||
|
|
||||||
activate_c () {
|
activate_c () {
|
||||||
c=1
|
c=1
|
||||||
coption="$coption -target c"
|
coption="$coption -target c"
|
||||||
|
@ -210,6 +250,26 @@ activate_all () {
|
||||||
activate_c
|
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
|
# -1, -2, -3, -v1, -v2, -v3 kept for backward compatibility
|
||||||
# (to be suppressed)
|
# (to be suppressed)
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
|
@ -229,14 +289,43 @@ while [ $# -gt 0 ]; do
|
||||||
"-c" )
|
"-c" )
|
||||||
activate_c
|
activate_c
|
||||||
shift;;
|
shift;;
|
||||||
|
"-caml" )
|
||||||
|
activate_caml
|
||||||
|
shift;;
|
||||||
|
"-vhdl" )
|
||||||
|
activate_vhdl
|
||||||
|
shift;;
|
||||||
"-mls" )
|
"-mls" )
|
||||||
activate_minils
|
activate_minils
|
||||||
shift;;
|
shift;;
|
||||||
|
"-tomato" )
|
||||||
|
activate_tomato
|
||||||
|
shift;;
|
||||||
|
"-cse" )
|
||||||
|
activate_cse
|
||||||
|
shift;;
|
||||||
|
"-inter" )
|
||||||
|
activate_inter
|
||||||
|
shift;;
|
||||||
|
"-bool" )
|
||||||
|
activate_boolean
|
||||||
|
shift;;
|
||||||
|
"-deadcode" )
|
||||||
|
activate_deadcode
|
||||||
|
shift;;
|
||||||
"-h" )
|
"-h" )
|
||||||
echo "usage : $0 <options> <compilo>"
|
echo "usage : $0 <options> <compilo>"
|
||||||
echo "options : "
|
echo "options : "
|
||||||
echo "-clean : clean build dir"
|
echo "-clean : clean build dir"
|
||||||
echo "-java : test of code generation (java code)"
|
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 "-c : test of code generation (c code)"
|
||||||
echo "-all : test all"
|
echo "-all : test all"
|
||||||
echo "-v : verbose"
|
echo "-v : verbose"
|
||||||
|
|
Loading…
Reference in a new issue