Commit e1147a13 authored by MARCHE Claude's avatar MARCHE Claude

Insert tests in bench, but only if mpfr is installed

parent abc83363
......@@ -7,6 +7,8 @@
# export WHY3DATA=.
# export WHY3LOADPATH=theories
has_mpfr=`sed -n -e 's/MPFRLIB *= *\([^ ]\+\)/\1/p' share/Makefile.config`
shopt -s nullglob
suffix=$1
......@@ -382,6 +384,21 @@ execute examples/vstte10_queens.mlw NQueens.test8
# examples/queens.mlw NQueensBits.test8
# fails: cannot find definition of routine eq
# examples/residual.mlw Test.test_astar
# test of execution on real numbers; only if mpfr installed
if test -n "$has_mpfr"; then
execute bench/interp/real.mlw R.test0
execute bench/interp/real.mlw R.test1
execute bench/interp/real.mlw R.test2
execute bench/interp/real.mlw R.test3
execute bench/interp/real.mlw R.test_exp
execute bench/interp/real.mlw R.test_log
execute bench/interp/real.mlw R.test_exp_log
execute bench/interp/real.mlw R.bench1
execute bench/interp/real.mlw R.bench2
execute bench/interp/real.mlw R.bench3
else
echo "MPFR not installed, skipping tests"
fi
echo ""
echo "=== Checking extraction to OCaml ==="
......
......@@ -35,6 +35,15 @@ module R
if z < 0.99999 || z > 1.00001 then raise BenchFailure;
(x, y, z)
let test3 ()
raises { BenchFailure -> false }
=
let ref x : real = 2.0 in
for i=1 to 14 do x <- x * x done;
let y : real = 0.0 * x in
if y <> 0.0 then raise BenchFailure;
(x,y)
let test_exp ()
raises { BenchFailure -> false }
=
......@@ -79,15 +88,6 @@ module R
if r <> 4.0 then raise BenchFailure;
r
let test3 ()
raises { BenchFailure -> false }
=
let ref x : real = 2.0 in
for i=1 to 14 do x <- x * x done;
let y : real = 0.0 * x in
if y <> 0.0 then raise BenchFailure;
(x,y)
use real.Trigonometry
let bench3 () =
......
......@@ -34,6 +34,7 @@ let localdir = $localdir
echo "
OCAMLBEST = @OCAMLBEST@
BIGINTLIB = @BIGINTLIB@
MPFRLIB = @MLMPFR@
INCLUDE = @BIGINTINCLUDE@ -I \"$ocamllib\"
INCLUDEALL = @BIGINTINCLUDE@ @ZIPINCLUDE@ @MENHIRINCLUDE@ -I \"$ocamllib\"
" > $makefileconfig
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment