From: acondolu Date: Tue, 11 Jul 2017 13:42:09 +0000 (+0200) Subject: Run tests with: make run X-Git-Tag: weak-reduction-separation~60 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=bd621e95f496a5cd40ca75548f32c063212b8987;p=fireball-separation.git Run tests with: make run --- diff --git a/ocaml/Makefile b/ocaml/Makefile index b4b12e0..46242b1 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -5,6 +5,11 @@ UTILS = parser.cmx console.cmx listx.cmx util.cmx pure.cmx num.cmx all: a.out test4.out # test.out +run: FORCE test4.out + bash run + +FORCE: + a.out: $(UTILS) lambda4.cmx problems.cmx $(OCAMLC) -o a.out $(LIB) $^ @@ -28,4 +33,4 @@ clean: include .depend -.PHONY: clean all +.PHONY: clean all run diff --git a/ocaml/run b/ocaml/run new file mode 100644 index 0000000..7a6436d --- /dev/null +++ b/ocaml/run @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +file=`mktemp` + +echo +echo "Running test. Log file: $file." +echo + +trap 'echo' SIGINT + +if ( ./test4.out 2>&1 | tee $file | stdbuf -o0 grep -Po '(?<=measure=)[^ ]*' | stdbuf -o0 tr '\n' ' ') +then { + rm $file + echo + echo 'Test succeeded' +} +else { + echo '' + echo 'Test failed or interrupted' + echo "Please have a look at log file: $file ." +} +fi