Mantis Bugtracker

Erweiterte Problemanzeige Zu Notizen wechseln ] einfache Anzeige ] Problem-Historie ] Drucken ]
ID Kategorie Auswirkung Reproduzierbar Meldungsdatum Letzte Aktualisierung
0000041 [Bisect] general schwerer Fehler immer 2009-06-05 18:36 2009-12-17 19:59
Reporter mfurr Anzeigestatus öffentlich  
Bearbeitung durch xclerc
Priorität normal Lösung erledigt Rechnertyp
Status geschlossen   Betriebssystem
Projektion keine   BS-Version
Aufwand keine Behoben in Version 1.0 Produktversion 1.0beta
  Zielversion Produkt-Build
Zusammenfassung 0000041: Patch: support for multiple directories
Beschreibung The instrument pp stores only the relative filenames of the source files, so bisect fails to work on projects that split up files into sub directories. Here's a trivial patch that fixes the problem.
Schritte zur Reproduktion
Zusätzliche Information diff -ur bisect-1.0-beta/src/instrument.ml bisect-1.0-beta.new/src/instrument.ml
--- bisect-1.0-beta/src/instrument.ml 2009-05-31 11:26:34.000000000 -0400
+++ bisect-1.0-beta.new/src/instrument.ml 2009-06-05 12:33:03.000000000 -0
400
@@ -80,6 +80,10 @@
     let _loc = Loc.ghost in
     <:expr< (Bisect.Runtime.mark $str:file$ $int:string_of_int idx$) >>
 
+(* Prepend the current working directory to the filename to get an
+ absolute filename *)
+let full_path file = Filename.concat (Sys.getcwd()) file
+
 (* Wraps an expression with a marker, returning the passed expression
    unmodified if the expression is already marked, is a bare mapping,
    or has a ghost location. *)
@@ -92,7 +96,7 @@
       let ofs = Loc.start_off loc in
       Ast.ExSeq (loc,
                  Ast.ExSem (loc,
- (marker (Loc.file_name loc) ofs k),
+ (marker (full_path (Loc.file_name loc)) ofs k),
                             e))
     with Already_marked -> e
 
@@ -165,7 +169,7 @@
       | Ast.StVal (loc, rc, bnd) -> Ast.StVal (loc, rc, (wrap_binding bnd))
       | x -> x in
       let loc = Ast.loc_of_str_item si in
- let file = Loc.file_name loc in
+ let file = full_path (Loc.file_name loc) in
       if not (List.mem file !files) && not (Loc.is_ghost loc) then
         let _loc = Loc.ghost in
         let e = <:expr< (Bisect.Runtime.init $str:file$) >> in
Tags Keine Tags zugeordnet.
Angehängte Dateien

- Problem-Beziehungen

-  Notiz
(0000182)
xclerc (Administrator)
2009-06-05 22:09
bearbeitet am: 2009-06-05 22:11

This is indeed an annoying weakness of Bisect in its current (1.0-beta) version.
In the manual, the third paragraph of the section titled "Generating the coverage report"
aknowledges this problem and tries to provide a workaround by suggesting the
use of "absolute" paths, or at least "discriminating" paths.

I reckon that this is not a very satisfactory solution. However, I am not very found
of the idea of always storing the full path. It is not uncommon to have a directory
either moved or mounted to a different point of the file system. In such cases, the
fix proposed by the reporter would cause some trouble.

As a consequence, I put forward another possible fix for this problem:
  - still store the path as given by the user on the command-line;
  - add a "-I <path>" command-line option to "bisect-report" to
    be able to specify a search path at report.
The idea is to be as flexible as possible, and to be consistent with the original
OCaml tools (the compilers defining a "-I" command-line option with the very
same semantics).


Any comment or alternative solution is of course welcome in order to help to
settle on the appropriate fix.

(0000183)
mfurr (Reporter)
2009-06-05 22:43

I had only skimmed over the manual and so I didn't see the recommendation there. Adding a -I option would be a great solution, especially if the user could pass multiple -I flags (like with ocamlc/opt), which would make integrating the report generation with a build system even easier.

- Problem-Historie
Änderungsdatum Benutzername Feld Änderung
2009-06-05 18:36 mfurr Neues Problem
2009-06-05 22:09 xclerc Problemnotiz hinzugefügt: 0000182
2009-06-05 22:09 xclerc Bearbeitung durch => xclerc
2009-06-05 22:09 xclerc Status neu => anerkannt
2009-06-05 22:11 xclerc Problemnotiz bearbeitet: 0000182
2009-06-05 22:43 mfurr Problemnotiz hinzugefügt: 0000183
2009-12-17 19:59 xclerc Status anerkannt => geschlossen
2009-12-17 19:59 xclerc Lösung offen => erledigt
2009-12-17 19:59 xclerc Behoben in Version => 1.0


Mantis 1.1.7[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker