matitac: $(LIB_DEPS) $(CCMOS) matitac.ml
$(OCAMLC) $(CPKGS) -linkpkg -o $@ $(CCMOS) matitac.ml
-matitac.opt: $(LIBX_DEPS) $(CMXS) matitac.ml
+matitac.opt: $(LIBX_DEPS) $(CCMXS) matitac.ml
$(OCAMLOPT) $(CPKGS) -linkpkg -o $@ $(CCMXS) matitac.ml
cicbrowser: matita
rm -f matita.glade.bak matita.gladep.bak
rm -rf autom4te.cache/
-tests: matitac
- for i in tests/*.ma; do (./matitac $$i 2> /dev/null > /dev/null && echo "\e[0;32m[OK]\e[0m $$i") || echo "\e[0;31m[KO]\e[0m $$i"; done
-.PHONY: tests
+tests: matita
+ @scripts/do_tests.sh ./matitac /dev/null tests/*.ma
+tests.opt: matitac.opt
+ @scripts/do_tests.sh ./matitac.opt /dev/null tests/*.ma
+.PHONY: tests tests.opt
tags: TAGS
.PHONY: TAGS
--- /dev/null
+DROP TABLE bench;
+
+CREATE TABLE bench (
+ mark VARCHAR(100) NOT NULL,
+ time TIME NOT NULL,
+ compilation ENUM('byte','opt') NOT NULL,
+ test VARCHAR(100) NOT NULL,
+ result ENUM('ok','fail') NOT NULL,
+ options SET('no-gc')
+);
+
+DESCRIBE bench;
+
+select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where options = '' group by mark;
+select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where test LIKE '%uto.ma' and options = '' group by mark;
+select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where options = 'no-gc' group by mark;
+select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where test LIKE '%uto.ma' and options = 'no-gc' group by mark;
--- /dev/null
+#!/bin/bash
+
+OK="\e[32mOK\e[0m"
+FAIL="\e[31mFAIL\e[0m"
+
+if [ "$1" = "-no-color" ]; then
+ shift
+ OK="OK"
+ FAIL="FAIL"
+fi
+
+COMPILER=$1
+shift
+LOGFILE=$1
+shift
+TODO="$@"
+
+if [ -z "$COMPILER" -o -z "$LOGFILE" -o -z "$TODO" ]; then
+ echo
+ echo "usage: "
+ echo " do_tests.sh [-no-color] ./compiler logfile tests.ma ..."
+ echo
+ echo "The value of the DO_TESTS_EXTRA evironment variable"
+ echo "will be appended to each line."
+ exit 1
+fi
+
+TMP=.__temp.txt
+
+for T in $TODO; do
+ echo -en "$COMPILER\t$T\t"
+ /usr/bin/time -o $TMP -f "%E\t%U\t%S" $COMPILER $T >> $LOGFILE 2>&1
+ if [ $? = 0 ]; then
+ echo -e "$OK\t`cat $TMP`\t$DO_TESTS_EXTRA"
+ else
+ echo -e "$FAIL\t`cat $TMP`\t$DO_TESTS_EXTRA"
+ fi
+done
+
+rm $TMP
--- /dev/null
+
+
+/^[^#]/ {
+ result=tolower($1);
+ if( $2 ~ "\.opt$" )
+ compilation="opt"
+ else
+ compilation="byte"
+ test=$3
+ time="0:" $4
+ mark=$7
+ if ( $8 ~ "^GC=off$")
+ options="'no-gc'"
+ else
+ options="''"
+
+ printf "INSERT bench (result, compilation, test, time, mark, options) VALUES ('%s', '%s', '%s', '%s', '%s', %s);\n", result, compilation, test, time, mark, options;
+ }
--- /dev/null
+#!/bin/bash
+MARK=`date +%Y%m%d`
+TMPDIRNAME=.__$MARK
+CVSROOT=":ext:$USER@marcello.cs.unibo.it:/home/faculty/PROJECTS/cvs/helm"
+
+function testit {
+ MARK=`date +%Y%m%d`
+ LOGTOOPT=/dev/null
+ LOGTOBYTE=/dev/null
+ export DO_TESTS_EXTRA="$MARK\t$n"
+ ls
+ scripts/do_tests.sh -nocolor ./matitac.opt $LOGTOOPT tests/*.ma
+ scripts/do_tests.sh -nocolor ./matitac $LOGTOBYTE tests/*.ma
+}
+
+function compile {
+ make -C $1 all opt 1>/dev/null 2>/dev/null
+ make -C $2 matitac matitac.opt 1>/dev/null 2>/dev/null
+}
+
+function run_tests {
+ OLD=`pwd`
+ cd $1
+ export OCAMLRUNPARAM='o=1000000'
+ testit $IMPL "off" 1>/dev/null 2>/dev/null
+ testit $IMPL "off"
+ export OCAMLRUNPARAM=''
+ testit $IMPL "on" 1>/dev/null 2>/dev/null
+ testit $IMPL "on"
+ cd $OLD
+}
+
+rm -rf $TMPDIRNAME
+mkdir $TMPDIRNAME
+cd $TMPDIRNAME
+
+cvs -d $CVSROOT co helm/ocaml 1>/dev/null 2>/dev/null
+cvs -d $CVSROOT co helm/matita 1>/dev/null 2>/dev/null
+compile $PWD/helm/ocaml $PWD/helm/matita
+run_tests $PWD/helm/matita #> LOG
+