From 368d854566ee076618be625d0223657d31f8e13d Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sun, 30 Sep 2018 18:49:34 +0200 Subject: [test-suite] Use ocamlfind to locate Coq libraries in unit tests. This is slightly more robust and allows to run the test suite with Dune which may place OCaml objects differently. --- test-suite/Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'test-suite') diff --git a/test-suite/Makefile b/test-suite/Makefile index e35393b5e8..5e465ab47d 100644 --- a/test-suite/Makefile +++ b/test-suite/Makefile @@ -250,11 +250,11 @@ $(addsuffix .log,$(wildcard bugs/closed/*.v)): %.v.log: %.v # Unit tests ####################################################################### -OCAMLOPT := $(OCAMLFIND) opt $(CAMLFLAGS) -SYSMOD:=-package num,str,unix,dynlink,threads +ifeq ($(LOCAL),true) + export OCAMLPATH := $(patsubst "%",%,$(COQLIBINSTALL)) +endif -COQSRCDIRS:=$(addprefix -I $(LIB)/,$(CORESRCDIRS)) -COQCMXS:=$(addprefix $(LIB)/,$(LINKCMX)) +OCAMLOPT := $(OCAMLFIND) opt $(CAMLFLAGS) # ML files from unit-test framework, not containing tests UNIT_SRCFILES:=$(shell find ./unit-tests/src -name *.ml) @@ -278,10 +278,8 @@ unit-tests: $(UNIT_LOGFILES) # Build executable, run it to generate log file unit-tests/%.ml.log: unit-tests/%.ml $(SHOW) 'TEST $<' - $(HIDE)$(OCAMLOPT) -linkall -linkpkg -cclib -lcoqrun \ - $(SYSMOD) -package camlp5.gramlib,oUnit \ - -I unit-tests/src $(COQSRCDIRS) $(COQCMXS) \ - $(UNIT_CMXS) $< -o $<.test; + $(HIDE)$(OCAMLOPT) -linkall -linkpkg -package coq.toplevel,oUnit \ + -I unit-tests/src $(UNIT_CMXS) $< -o $<.test; $(HIDE)./$<.test ####################################################################### -- cgit v1.2.3 From 41dcd52864a569d2a0305ce97ad335238a0bc17d Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 4 Oct 2018 09:57:09 +0000 Subject: [default.nix] Add install dir to OCAMLPATH before running the test-suite --- test-suite/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test-suite') diff --git a/test-suite/Makefile b/test-suite/Makefile index 5e465ab47d..d088702b44 100644 --- a/test-suite/Makefile +++ b/test-suite/Makefile @@ -250,8 +250,11 @@ $(addsuffix .log,$(wildcard bugs/closed/*.v)): %.v.log: %.v # Unit tests ####################################################################### +# COQLIBINSTALL is quoted in config/make thus we must unquote it, +# otherwise the directory name will include the quotes, see +# see for example https://stackoverflow.com/questions/10424645/how-to-convert-a-quoted-string-to-a-normal-one-in-makefile ifeq ($(LOCAL),true) - export OCAMLPATH := $(patsubst "%",%,$(COQLIBINSTALL)) + export OCAMLPATH := $(shell echo $(COQLIBINSTALL)) endif OCAMLOPT := $(OCAMLFIND) opt $(CAMLFLAGS) -- cgit v1.2.3