]> matita.cs.unibo.it Git - fireball-separation.git/commitdiff
Run tests with: make run
authoracondolu <andrea.condoluci@unibo.it>
Tue, 11 Jul 2017 13:42:09 +0000 (15:42 +0200)
committeracondolu <andrea.condoluci@unibo.it>
Tue, 11 Jul 2017 13:42:09 +0000 (15:42 +0200)
ocaml/Makefile
ocaml/run [new file with mode: 0644]

index b4b12e06da3fc9e398bc7e4c9c4e8e001c75ba63..46242b1546576e0a85503491d3e874b5f42c3ba1 100644 (file)
@@ -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 (file)
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