--- layout: fc_discuss_archives title: Message 45 from Frama-C-discuss on July 2012 ---
Hi, On Fri, Jul 20, 2012 at 6:48 AM, haihao shen <haihaoshen at gmail.com> wrote: > I saw from the Makefile of Frama-c that there is something related with code > coverage. I am wondering whether this feature could be used inside Frama-c. > If not, do you know how to measure code coverage for Ocaml code? Thanks. The Makefile section you noticed uses the code from this project: http://ocaml-coverage.sourceforge.net/ However, it has remained unused for years. In order to compile said project, I add to patch the generated Makefile this way: --- Makefile 2012-07-25 16:26:18.653952714 +0200 +++ Makefile 2012-07-25 16:21:22.693155350 +0200 @@ -23,7 +23,7 @@ # other variables set by ./configure CAMLP4 = camlp4o -CAMLP4_OPTIONS= -parser OCamlQuotation -parser Grammar +CAMLP4_OPTIONS= -parser Camlp4QuotationCommon -parser Camlp4OCamlOriginalQuotationExpander -parser Grammar # -parser OCaml -parser OCamlParser -parser OCamlQuotationBase OCAMLC = ocamlc.opt -dtypes OCAMLOPT = ocamlopt.opt -dtypes @@ -36,7 +36,7 @@ OCAMLWEB = true OCAMLWIN32 = no EXE = -INCLUDES = -I +camlp4 +INCLUDES = -I +camlp4 -I +camlp4/Camlp4Parsers BFLAGS = -g $(INCLUDES) OFLAGS = $(INCLUDES) GRAMMAR_COMPILER= $(OCAMLC) $(BFLAGS) -pp "$(CAMLP4) $(CAMLP4_OPTIONS)" However, I did not test the result, I just made sure it compiled. So I cannot give you much more information than this. HTH, -- Boris