check cleaned up.

This commit is contained in:
Léonard Gérard 2011-01-12 16:08:33 +01:00
parent e2cbf7f56f
commit 82250b7536

View file

@ -2,10 +2,6 @@
checkdir=_check_builds checkdir=_check_builds
if [ ! -d $checkdir ]; then
mkdir $checkdir
fi
cd $checkdir
# TODO: rewrite in OCaml or something better than sh # TODO: rewrite in OCaml or something better than sh
@ -31,10 +27,7 @@ c=0
score=0 score=0
max=0 max=0
verbose=0 verbose=0
clean=0
for d in ../good ../bad; do
rm -f -r $d/*.obc $d/*_java $d/*_c $d/*.mci $d/*.mls $d/*.epci
done
compile () { compile () {
args_comp="" args_comp=""
@ -54,10 +47,9 @@ compile () {
fi fi
if [ $verbose != 0 ]; then if [ $verbose != 0 ]; then
echo "" logfile=`basename $1`.log
echo "****************************************" echo "Compile -i $coption $args_comp $1"
echo Compile -i $coption $args_comp $1 $compilo $coption -I good $args_comp $1 >$logfile 2>&1
$compilo $coption -I good $args_comp $1 >$1.log 2>&1
else else
if [ $2 == 1 ]; then if [ $2 == 1 ]; then
$compilo $coption -I good $args_comp $1 >/dev/null 2>&1 $compilo $coption -I good $args_comp $1 >/dev/null 2>&1
@ -75,10 +67,18 @@ launch_check () {
score=0 score=0
max=0 max=0
echo "Test" if [ $clean = 1 ]; then
rm -r $checkdir
exit 0
fi
if [ ! -d $checkdir ]; then
mkdir $checkdir
fi
cd $checkdir
# les mauvais # les mauvais
echo -n "bad " echo "Tests bads"
for f in ../bad/*.ept ; do for f in ../bad/*.ept ; do
if [ $verbose = 0 ]; then if [ $verbose = 0 ]; then
echo -n "." echo -n "."
@ -92,9 +92,7 @@ launch_check () {
fi fi
done done
echo echo "Tests goods"
echo -n "bons"
for f in ../good/*.ept; do for f in ../good/*.ept; do
echec=0 echec=0
if [ $verbose = 0 ]; then if [ $verbose = 0 ]; then
@ -189,6 +187,10 @@ launch_check () {
echo -n "Test: $score/$max : $percent%"; echo -n "Test: $score/$max : $percent%";
} }
activate_clean () {
clean=1
}
activate_minils () { activate_minils () {
minils=1 minils=1
} }
@ -212,6 +214,9 @@ activate_all () {
# (to be suppressed) # (to be suppressed)
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case $1 in
"-clean" )
activate_clean
shift;;
"-v" ) "-v" )
verbose=1; verbose=1;
shift;; shift;;