Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Code Coverage for Ocaml Code


  • Subject: [Frama-c-discuss] Code Coverage for Ocaml Code
  • From: boris at yakobowski.org (Boris Yakobowski)
  • Date: Wed, 25 Jul 2012 16:27:50 +0200
  • In-reply-to: <CAL2=Xad+iAxU_mPTM_H9U4GvmM+ejubxCyZgRdH2yHKSV6fFzg@mail.gmail.com>
  • References: <CAL2=Xad+iAxU_mPTM_H9U4GvmM+ejubxCyZgRdH2yHKSV6fFzg@mail.gmail.com>

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