summaryrefslogtreecommitdiffstats
path: root/testsuite/makefiles/Makefile.dlambda
diff options
context:
space:
mode:
authorGabriel Scherer <gabriel.scherer@gmail.com>2014-11-17 12:05:33 +0000
committerGabriel Scherer <gabriel.scherer@gmail.com>2014-11-17 12:05:33 +0000
commita0f1d3e171be660396ced71be256735526bb168c (patch)
treef5d81c50e0b87d4636f2e11333d7a244f79a9084 /testsuite/makefiles/Makefile.dlambda
parenta9b0358f8ce1b168c088052cfbcd07f699e8b192 (diff)
testsuite/makefiles: a more robust -dlambda test
From: Gabriel Scherer <gabriel.scherer@gmail.com> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15584 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'testsuite/makefiles/Makefile.dlambda')
-rw-r--r--testsuite/makefiles/Makefile.dlambda31
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/makefiles/Makefile.dlambda b/testsuite/makefiles/Makefile.dlambda
new file mode 100644
index 000000000..bfc1cf461
--- /dev/null
+++ b/testsuite/makefiles/Makefile.dlambda
@@ -0,0 +1,31 @@
+#########################################################################
+# #
+# OCaml #
+# #
+# Xavier Clerc, SED, INRIA Rocquencourt #
+# #
+# Copyright 2010 Institut National de Recherche en Informatique et #
+# en Automatique. All rights reserved. This file is distributed #
+# under the terms of the Q Public License version 1.0. #
+# #
+#########################################################################
+
+# To avoid tests breaking each time the internal name generation
+# changes, we strip -dlambda-produced identifiers of their unique
+# identifier: "x/1234" becomes simply "x".
+
+default:
+ @for file in *.ml; do \
+ $(OCAMLC) -dlambda -c $$file 2>&1 | \
+ sed -e 's|\([A-Za-z_]\+\)/[0-9]\+|\1|g' > $$file.result; \
+ done
+ @for file in *.reference; do \
+ printf " ... testing '$$file':"; \
+ $(DIFF) $$file `basename $$file reference`result >/dev/null \
+ && echo " => passed" || echo " => failed"; \
+ done
+
+promote: defaultpromote
+
+clean: defaultclean
+ @rm -f *.result