summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile7
-rwxr-xr-xsrc/test/idempotence.sh14
2 files changed, 20 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index a1ce3583..b4265016 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,4 @@
-.PHONY: all test clean doc lib test_power
+.PHONY: all test clean doc lib test_power test_idempotence
all: lib doc
ocamlbuild -classic-display sail.native test/run_tests.native
@@ -11,6 +11,11 @@ test_power:
SAIL_OPTS=-skip_constraints ocamlbuild -classic-display sail.native test/run_power.native
./run_power.native --file ../../../rsem/idl/power/binary/main.bin
+test_idempotence:
+ @cd test; for file in *.sail; do \
+ ./idempotence.sh $$file; echo ;\
+ done
+
clean:
-ocamlbuild -clean
-rm -rf _build
diff --git a/src/test/idempotence.sh b/src/test/idempotence.sh
new file mode 100755
index 00000000..5527680d
--- /dev/null
+++ b/src/test/idempotence.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+input=$1
+sail=../sail.native
+
+output1=`mktemp --suffix=.sail`
+echo Pretty-printing $input
+$sail -verbose $input > $output1
+
+output2=`mktemp --suffix=.sail`
+echo Pretty-printing pretty-printed
+$sail -verbose $output1 > $output2
+
+diff -u $output1 $output2 && \
+ (rm -f $output1 $output2; echo Idempotence: ok)