package pfff

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file coverage_ml.ml

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
(* Yoann Padioleau
 *
 * Copyright (C) 2013 Facebook
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation, with the
 * special exception on linking described in file license.txt.
 * 
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the file
 * license.txt for more details.
 *)
open Common

(*****************************************************************************)
(* Prelude *)
(*****************************************************************************)

(*
 * - zamcov
 * - mlcov
 * - #trace
 * - ocamldebug?
 * - ?
 *)

(*****************************************************************************)
(* Helpers *)
(*****************************************************************************)

(*****************************************************************************)
(* API *)
(*****************************************************************************)

let basename_coverage_to_readable_coverage xs root =
  let files = Lib_parsing_ml.find_ml_files_of_dir_or_files [root] in
  let finder = Graph_code.basename_to_readable_disambiguator ~root files in
  xs +> List.map (fun (file, cover) ->
    match finder file with
    | [] ->
        failwith (spf "could not find basename %s in directory %s" file root)
    | [x] -> x, cover
    | x::y::_xs ->
        failwith (spf "ambiguity on %s (%s, %s, ...)" file x y)
  )

OCaml

Innovation. Community. Security.