简体   繁体   English

Windows 10上的GHC -fhpc代码覆盖率

[英]GHC -fhpc code coverage on Windows 10

I'm trying to check code coverage for my tasty unit tests. 我正在尝试检查我的美味单元测试的代码覆盖率。 I found a way to do it in the GHC docs user guide for hpc . 在hpc的GHC docs用户指南中找到了一种方法。 The problem is that ghc -fhpc Myfile.hs doesn't generate a .hpc subdirectory or any .tix file, as the documentation claims it to do. 问题是ghc -fhpc Myfile.hs不会生成.hpc子目录或任何.tix文件,正如文档所声称的那样。 Subsequently, I cannot run hpc report . 随后,我无法运行hpc report

What am I missing? 我错过了什么? Does this not work on Windows? 这不适用于Windows吗?

Apparently, removing all *.hi and *.o files, forcing the compiler to recompile, worked. 显然,删除所有*.hi*.o文件,迫使编译器重新编译,工作。 I really think the compiler should've noticed the flag, and that some files were missing. 我真的认为编译器应该注意到标志,并且有些文件丢失了。

https://ghc.haskell.org/trac/ghc/ticket/11798 https://ghc.haskell.org/trac/ghc/ticket/11798

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM