summaryrefslogtreecommitdiff
path: root/Makefile.bisect
blob: 43ecf4c1826c58bfe793a2f55259ff157f2b994f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

.PHONY: clean run report

BUILD_PARAM= \
  CAMLC=ocamlc.opt \
  OCAMLC=ocamlc.opt \
  CAMLOPT=ocamlopt.opt \
  OCAMLOPT=ocamlopt.opt \
  CAMLRUN=ocamlrun \
  OCAMLRUN=ocamlrun \
  CAMLYACC=ocamlyacc \
  CAMLLEX=ocamllex \
  MKLIB=ocamlmklib

TEST_PARAM= \
  BISECT_FILE=coverage \
  OCAMLC='$$(OTOPDIR)/ocamlc.opt $$(CUSTOM)' \
  OCAMLOPT='$$(OTOPDIR)/ocamlopt.opt' \
  OCAMLYACC='ocamlyacc' \
  OCAMLLEX='ocamllex' \
  OCAMLDOC='ocamldoc' \
  OCAMLMKLIB='ocamlmklib -ocamlc $$(OTOPDIR)/ocamlc.opt -ocamlopt $$(OTOPDIR)/ocamlopt.opt' \
  OCAMLRUN='ocamlrun'

LIB=$(ocamlfind printconf destdir)/ocaml-bisect

GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
GIT_COMMIT=$(shell git rev-parse --short HEAD)

TITLE :=OCaml compiler coverage while running the testsuite
ifneq (${GIT_COMMIT},)
ifeq (${GIT_BRANCH},)
TITLE+= (${GIT_COMMIT})
else
TITLE+= (${GIT_BRANCH} - ${GIT_COMMIT})
endif
endif

prepare:
	${MAKE} ${BUILD_PARAM} -C tools cvt_emit
	${MAKE} ${BUILD_PARAM} ocamlc.opt
	${MAKE} ${BUILD_PARAM} ocamlopt.opt

clean:
	-rm -f testsuite/tests/*/coverage*.out
	-rm -rf testsuite/tests/coverage

run:
	make ${TEST_PARAM} -C testsuite all || true

report:
	bisect-report -title "${TITLE}" -html testsuite/coverage testsuite/tests/*/coverage*.out

install-report:
	mkdir -p "${LIB}"
	cp -r testsuite/coverage "${LIB}/coverage"
	cp testsuite/_log "${LIB}/testsuite.log"

uninstall-report:
	rm -rf testsuite/coverage "${LIB}/coverage"
	rm -rf testsuite/_log "${LIB}/testsuite.log"

upload:
	rsync -avz --delete testsuite/coverage www-data@http.ocp:/var/www/flambda.ocamlpro.com/
	rsync -avz --delete testsuite/_log www-data@http.ocp:/var/www/flambda.ocamlpro.com/testsuite.log