Opened 7 years ago

Closed 7 years ago

#7419 closed feature request (fixed)

"hpc markup" should accept multiple .mix file search paths

Reported by: ttuegel Owned by: igloo
Priority: highest Milestone: 7.8.1
Component: Code Coverage Version: 7.6.1
Keywords: Cc: johan.tibell@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The markup mode of the hpc executable should accept multiple .mix file search paths by allowing specification of multiple '--hpcdir=' flags on the command line. Cabal needs this feature to be able to generate coverage reports for test suites in certain configurations. The hpc library already supports multiple search paths for a particular .mix file; all that is necessary is to make a change in the command line options the executable recognizes.

Attachments (1)

0001-Accept-multiple-.mix-file-search-paths-for-hpc-marku.patch (2.9 KB) - added by ttuegel 7 years ago.
Patch implementing feature

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by ttuegel

Patch implementing feature

comment:1 Changed 7 years ago by ttuegel

Status: newpatch

comment:2 Changed 7 years ago by tibbe

Cc: johan.tibell@… added

One question:

(\ a f -> f { hpcDirs = hpcDirs f ++ [a] }) 

Is there an implied search order here, if the same info could be found in multiple directories? If I do

hpc --hpc-dir=A --hpc-dir=B

Which one takes precedence? Which one should take precedence? I guess we should mimic e.g. how GHC treats multiple -i flags.

Patch looks good otherwise.

comment:3 Changed 7 years ago by ttuegel

The .mix file must not be found in multiple locations: the hpc library considers it an error for multiple .mix files to match. This sounds more constraining than it actually is, because matching is based on module name and a hash; one should only get multiple matches if the same file is checked twice.

(If you do hpc --hpc-dir=A --hpc-dir=B , hpc will search in the order you specified the directories, but it always searches all the paths.)

comment:4 Changed 7 years ago by tibbe

Component: CompilerCode Coverage

Thanks for clarifying. The code looks good to me. Please merge.

comment:5 Changed 7 years ago by tibbe

Anything else you need form us? I'd like to see this in 7.8.

comment:6 Changed 7 years ago by simonpj

difficulty: Unknown
Milestone: 7.8.1
Owner: set to igloo
Priority: normalhighest

Ian, I don't know the details of this one, but since the authors have been kind enough to develop a patch, could you review and (presumably) commit for 7.8, please?

I have not looked, but does the patch include suitable documentation in the user manual?


comment:7 Changed 7 years ago by igloo

Resolution: fixed
Status: patchclosed

Applied, and docs updated, thanks!

Note: See TracTickets for help on using tickets.