From 1c188afb6b94c2a82092f871b0151e0b323987db Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 25 Jan 2019 22:07:34 -0600 Subject: [PATCH] test: refactor a bit so that benchs are run by dune --- Makefile | 2 -- tests/dune | 9 +++++++++ tests/run | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b576e4b9..b24f052f 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,6 @@ build-dev: test: @echo "run tests…" @OCAMLRUNPARAM=b dune runtest --force --no-buffer - @echo "run benchmarks…" - @/usr/bin/time -f "%e" ./tests/run sat enable_log: cd src/core; ln -sf log_real.ml log.ml diff --git a/tests/dune b/tests/dune index 1c4c32dc..2dbfc6a6 100644 --- a/tests/dune +++ b/tests/dune @@ -10,14 +10,23 @@ (alias (name runtest) (deps test_api.exe) + (locks test) (action (run %{deps}))) (alias (name runtest) (deps ./icnf-solve/icnf_solve.exe Makefile (source_tree regression)) + (locks test) (action (run make test-icnf))) (alias (name runtest) (deps ./../src/sudoku/sudoku_solve.exe Makefile (source_tree sudoku)) + (locks test) (action (run make test-sudoku))) + +(alias + (name runtest) + (deps ./../src/main/main.exe ./run (source_tree .)) + (locks test) + (action (run /usr/bin/time -f "%e" ./run sat))) diff --git a/tests/run b/tests/run index 9275f63e..7720b5cb 100755 --- a/tests/run +++ b/tests/run @@ -1,7 +1,7 @@ #!/bin/bash CURDIR=`dirname $0` -SOLVER="$CURDIR/../_build/default/src/main/main.exe" +SOLVER="$CURDIR/../src/main/main.exe" solvertest () { for f in `find -L $1 -type f -name '*.cnf' # -o -name '*.smt2'` @@ -18,5 +18,7 @@ solvertest () { echo -e "\r\033[K\e[32m[OK]\e[0m $3/$2" } +echo "run benchmarks…" + solvertest "$CURDIR/sat/" "Sat" $1 solvertest "$CURDIR/unsat/" "Unsat" $1