summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2017-10-04 19:17:43 +0100
committerDavid Allsopp <david.allsopp@metastack.com>2017-10-04 19:17:43 +0100
commit380989725e3976cff389cbb59ed74c60f2e3d560 (patch)
tree3aded88e7d97f98f6a6c62c2ab83ee7fc14f3be4
parent74ca5ee7a3f7d9fb65b9bbb4495549b2f8752784 (diff)
downloadocaml-380989725e3976cff389cbb59ed74c60f2e3d560.tar.gz
Simplify the tool-ocamlobjinfo test
-rw-r--r--testsuite/tests/tool-ocamlobjinfo/Makefile21
-rw-r--r--testsuite/tests/tool-ocamlobjinfo/question.ml1
-rw-r--r--testsuite/tests/tool-ocamlobjinfo/test.clambda.reference45
-rw-r--r--testsuite/tests/tool-ocamlobjinfo/test.flambda.reference48
-rw-r--r--testsuite/tests/tool-ocamlobjinfo/test.reference10
5 files changed, 18 insertions, 107 deletions
diff --git a/testsuite/tests/tool-ocamlobjinfo/Makefile b/testsuite/tests/tool-ocamlobjinfo/Makefile
index ed4ba04534..19a745c733 100644
--- a/testsuite/tests/tool-ocamlobjinfo/Makefile
+++ b/testsuite/tests/tool-ocamlobjinfo/Makefile
@@ -2,6 +2,9 @@ BASEDIR=../..
LD_PATH=
+# This test ensures that ocamlobjinfo is behaving as the configuration
+# expects and is a guard against the breakage fixed in 17fc532
+
.PHONY: default
default:
@printf " ... testing 'ocamlobjinfo'"
@@ -10,23 +13,19 @@ default:
elif ! grep -q HAS_LIBBFD $(TOPDIR)/byterun/caml/s.h ; then \
echo ' => skipped (BFD library not available)'; \
else \
- case " $(OTHERLIBRARIES) " in \
- *' unix '* | *' win32unix '*) \
- $(SET_LD_PATH) OCAMLLIB=$(TOPDIR)/tools $(MAKE) run;; \
- *) echo ' => skipped (unix.cmxs not available)';; \
- esac \
+ $(SET_LD_PATH) OCAMLLIB=$(TOPDIR)/tools $(MAKE) run; \
fi
.PHONY: run
run:
@rm -f $(MAIN_MODULE).result
+ @$(OCAMLOPT) -shared -o question.cmxs question.ml
@$(OCAMLRUN) `$(CYGPATH) $(TOPDIR)/tools/ocamlobjinfo` \
- $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix/unix.cmxs \
+ question.cmxs \
> test.raw.result 2>&1 \
&& sed -e 's/\([^0-9a-z]\)[0-9a-z]\{32\}\([^0-9a-z]\|$$\)/\1<MD5>\2/' \
- -e 's/File .*otherlibs/File otherlibs/' \
test.raw.result > test.result \
- && $(DIFF) test.$(BACKEND).reference test.result > /dev/null \
+ && $(DIFF) test.reference test.result > /dev/null \
&& echo " => passed" || echo " => failed"
.PHONY: promote
@@ -37,9 +36,3 @@ clean: defaultclean
@rm -f *.result
include $(BASEDIR)/makefiles/Makefile.common
-
-ifeq "$(FLAMBDA)" "true"
-BACKEND=flambda
-else
-BACKEND=clambda
-endif
diff --git a/testsuite/tests/tool-ocamlobjinfo/question.ml b/testsuite/tests/tool-ocamlobjinfo/question.ml
new file mode 100644
index 0000000000..cd298427b2
--- /dev/null
+++ b/testsuite/tests/tool-ocamlobjinfo/question.ml
@@ -0,0 +1 @@
+let answer = 42
diff --git a/testsuite/tests/tool-ocamlobjinfo/test.clambda.reference b/testsuite/tests/tool-ocamlobjinfo/test.clambda.reference
deleted file mode 100644
index 0289c20231..0000000000
--- a/testsuite/tests/tool-ocamlobjinfo/test.clambda.reference
+++ /dev/null
@@ -1,45 +0,0 @@
-File otherlibs/unix/unix.cmxs
-Name: Unix
-CRC of implementation: <MD5>
-Globals defined:
- Unix
-Interfaces imported:
- <MD5> Unix
- <MD5> Uchar
- <MD5> Sys
- <MD5> String
- <MD5> Printf
- <MD5> Printexc
- <MD5> Pervasives
- <MD5> List
- <MD5> Hashtbl
- <MD5> Complex
- <MD5> CamlinternalFormatBasics
- <MD5> CamlinternalBigarray
- <MD5> Callback
- <MD5> Bytes
- <MD5> Buffer
- <MD5> Array
-Implementations imported:
- <MD5> Sys
- <MD5> Printf
- <MD5> Printexc
- <MD5> Pervasives
- <MD5> List
- <MD5> Hashtbl
- <MD5> Callback
- <MD5> Bytes
- <MD5> Array
-Name: UnixLabels
-CRC of implementation: <MD5>
-Globals defined:
- UnixLabels
-Interfaces imported:
- <MD5> UnixLabels
- <MD5> Unix
- <MD5> Pervasives
- <MD5> Complex
- <MD5> CamlinternalFormatBasics
- <MD5> CamlinternalBigarray
-Implementations imported:
- <MD5> Unix
diff --git a/testsuite/tests/tool-ocamlobjinfo/test.flambda.reference b/testsuite/tests/tool-ocamlobjinfo/test.flambda.reference
deleted file mode 100644
index ac75841e1a..0000000000
--- a/testsuite/tests/tool-ocamlobjinfo/test.flambda.reference
+++ /dev/null
@@ -1,48 +0,0 @@
-File otherlibs/unix/unix.cmxs
-Name: Unix
-CRC of implementation: <MD5>
-Globals defined:
- Unix
-Interfaces imported:
- <MD5> Unix
- <MD5> Uchar
- <MD5> Sys
- <MD5> String
- <MD5> Printf
- <MD5> Printexc
- <MD5> Pervasives
- <MD5> List
- <MD5> Hashtbl
- <MD5> Complex
- <MD5> CamlinternalFormatBasics
- <MD5> CamlinternalBigarray
- <MD5> Callback
- <MD5> Bytes
- <MD5> Buffer
- <MD5> Array
-Implementations imported:
- <MD5> CamlinternalFormat
- <MD5> Random
- <MD5> CamlinternalLazy
- <MD5> Hashtbl
- <MD5> Array
- <MD5> List
- <MD5> Bytes
- <MD5> Pervasives
- <MD5> Sys
- <MD5> Printexc
- <MD5> Printf
- <MD5> Callback
-Name: UnixLabels
-CRC of implementation: <MD5>
-Globals defined:
- UnixLabels
-Interfaces imported:
- <MD5> UnixLabels
- <MD5> Unix
- <MD5> Pervasives
- <MD5> Complex
- <MD5> CamlinternalFormatBasics
- <MD5> CamlinternalBigarray
-Implementations imported:
- <MD5> Unix
diff --git a/testsuite/tests/tool-ocamlobjinfo/test.reference b/testsuite/tests/tool-ocamlobjinfo/test.reference
new file mode 100644
index 0000000000..dab40e8ce4
--- /dev/null
+++ b/testsuite/tests/tool-ocamlobjinfo/test.reference
@@ -0,0 +1,10 @@
+File question.cmxs
+Name: Question
+CRC of implementation: <MD5>
+Globals defined:
+ Question
+Interfaces imported:
+ <MD5> Question
+ <MD5> Pervasives
+ <MD5> CamlinternalFormatBasics
+Implementations imported: