Testsuite/Coverage: initial commit for code coverage

This commit is contained in:
Çağdaş Bozman 2016-10-19 14:29:02 +02:00 committed by Grégoire Henry
parent ce54c5bc3d
commit 9834aa9d6c
6 changed files with 44 additions and 10 deletions

4
.gitignore vendored
View File

@ -21,6 +21,7 @@
/src/client/embedded/bootstrap/concrete_parser.mli /src/client/embedded/bootstrap/concrete_parser.mli
/test/.depend /test/.depend
/test/reports
/test/test-store /test/test-store
/test/test-state /test/test-state
@ -39,8 +40,11 @@
*.cmti *.cmti
*.cmxa *.cmxa
*.cmxs *.cmxs
*.cmp
*.mli.deps *.mli.deps
*.ml.deps *.ml.deps
bisect*.out
*.rej *.rej
*.orig *.orig

View File

@ -142,7 +142,8 @@ UTILS_PACKAGES := \
lwt \ lwt \
ocplib-json-typed \ ocplib-json-typed \
sodium \ sodium \
zarith zarith \
$(COVERAGEPKG) \
UTILS_OBJS := \ UTILS_OBJS := \
${UTILS_LIB_IMPLS:.ml=.cmx} ${UTILS_LIB_IMPLS:.ml=.ml.deps} \ ${UTILS_LIB_IMPLS:.ml=.cmx} ${UTILS_LIB_IMPLS:.ml=.ml.deps} \
@ -167,10 +168,10 @@ COMPILER_LIB_INTFS := \
COMPILER_LIB_IMPLS := \ COMPILER_LIB_IMPLS := \
compiler/embedded_cmis.ml \ compiler/embedded_cmis.ml \
compiler/tezos_compiler.ml compiler/tezos_compiler.ml \
COMPILER_IMPLS := \ COMPILER_IMPLS := \
compiler_main.ml compiler_main.ml \
COMPILER_PACKAGES := \ COMPILER_PACKAGES := \
${UTILS_PACKAGES} \ ${UTILS_PACKAGES} \
@ -179,7 +180,7 @@ COMPILER_PACKAGES := \
lwt.unix \ lwt.unix \
ocplib-endian \ ocplib-endian \
ocplib-ocamlres \ ocplib-ocamlres \
unix unix \
COMPILER_OBJS := \ COMPILER_OBJS := \
${COMPILER_IMPLS:.ml=.cmx} ${COMPILER_IMPLS:.ml=.ml.deps} \ ${COMPILER_IMPLS:.ml=.cmx} ${COMPILER_IMPLS:.ml=.ml.deps} \
@ -277,7 +278,8 @@ NODE_PACKAGES := \
dynlink \ dynlink \
git \ git \
irmin.unix \ irmin.unix \
ocplib-resto.directory ocplib-resto.directory \
EMBEDDED_NODE_PROTOCOLS := \ EMBEDDED_NODE_PROTOCOLS := \
$(patsubst proto/%/,proto/embedded_proto_%.cmxa, \ $(patsubst proto/%/,proto/embedded_proto_%.cmxa, \
@ -426,7 +428,7 @@ clean::
.PHONY: clean .PHONY: clean
clean:: clean::
-find \( -name \*.cm\* -or -name \*~ -or -name \*.o -or -name \*.a \) -delete -find \( -name \*.cm\* -or -name \*.cmp -or -name \*.out -or -name \*~ -or -name \*.o -or -name \*.a \) -delete
## Dependencies ## Dependencies

View File

@ -1,4 +1,8 @@
ifeq ($(strip ${COVERAGE}),yes)
COVERAGEPKG := bisect_ppx
endif
INCLUDES = \ INCLUDES = \
$(patsubst %, -I %, $(SOURCE_DIRECTORIES)) \ $(patsubst %, -I %, $(SOURCE_DIRECTORIES)) \
$(patsubst %, -package %, $(PACKAGES)) \ $(patsubst %, -package %, $(PACKAGES)) \

View File

@ -28,5 +28,6 @@ depends: [
"ocplib-json-typed" "ocplib-json-typed"
"ocplib-resto" {>= "dev"} "ocplib-resto" {>= "dev"}
"sodium" {>= "0.3.0"} "sodium" {>= "0.3.0"}
"kaputt" "kaputt" (* only for testing *)
"bisect_ppx" (* only for testing *)
] ]

View File

@ -22,4 +22,4 @@ B ./lib
FLG -w -40 FLG -w -40
PKG lwt PKG lwt
PKG sodium PKG sodium
PKG kaputt PKG kaputt

View File

@ -42,7 +42,8 @@ PACKAGES := \
ocplib-resto.directory \ ocplib-resto.directory \
sodium \ sodium \
unix \ unix \
kaputt kaputt \
bisect_ppx.runtime
############################################################################ ############################################################################
## External packages ## External packages
@ -190,6 +191,28 @@ test-data-encoding: ${NODELIB} ${TEST_DATA_ENCODING_IMPLS:.ml=.cmx}
clean:: clean::
rm -f test-data-encoding rm -f test-data-encoding
COVERAGESRCDIR= \
-I ../src \
-I ../src/client \
-I ../src/client/embedded \
-I ../src/client/embedded/bootstrap \
-I ../src/client/embedded/bootstrap/mining \
-I ../src/client/embedded/bootstrap/demo \
-I ../src/compiler \
-I ../src/node \
-I ../src/node/db \
-I ../src/node/updater \
-I ../src/node/net \
-I ../src/node/shell \
-I ../src/proto \
-I ../src/proto/bootstrap \
-I ../src/proto/demo \
-I ../src/utils
bisect:
bisect-ppx-report $(COVERAGESRCDIR) \
-ignore-missing-files -html reports bisect*.out
############################################################################ ############################################################################
## Generic rules ## Generic rules
@ -205,7 +228,7 @@ test.cmx: test.cmi
ocamlfind ocamlc ${OCAMLFLAGS} -c $< ocamlfind ocamlc ${OCAMLFLAGS} -c $<
clean:: clean::
-rm -f *.cm* lib/*.cm* -rm -f *.cm* lib/*.cm* *.out *.o
-include .depend -include .depend
.depend: $(wildcard *.ml *.mli lib/*.ml lib/*.mli) .depend: $(wildcard *.ml *.mli lib/*.ml lib/*.mli)