First, instrument the exe or dll by command

vsinstr -coverage the dll/exe

second, start the performance monitor

VSPerfCmd.exe /start:coverage /output:"D:\Latest.Coverage" /cs /user:"Everyone"

at this time, we could check the status by running command:

VSPerfCmd.exe /status

third, start the windows service  and execute the test scenario.

Fourth, shut down the performance monitor tool by

VSPerfCmd.exe /shutdown

Trouble shooting:

on the 64 bit machines, you may could not get the coverage, instead it shows message:

Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731

and in the event view, has error with source: VSPERF

Unable to connect to monitor.  Make sure the monitor is started and in the correct mode.

Resolving by:

Run the above command from the tools for x64 machines, it located at

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\x64

How to do code coverage test for windows service的更多相关文章

  1. 10 Code Coverage Tools for C & C++

    Code coverage is a measure used in software testing that describes the degree to which the source co ...

  2. Gumshoe - Microsoft Code Coverage Test Toolset

    Gumshoe - Microsoft Code Coverage Test Toolset 2014-07-17 What is Gumshoe? How to instrument a binar ...

  3. [Jest] Track project code coverage with Jest

    Jest comes pre-packaged with the ability to track code coverage for the modules you're testing, but ...

  4. Effective Java提升Code Coverage代码涵盖率 - 就是爱Java

    虽然我们已经有了测试程序,但是如何得知是否已完整测试了主程序?,透过Code Coverage代码涵盖率,我们可以快速地得知,目前系统中,有多少程序中被测试过,不考虑成本跟投资效益比,涵盖率越高,代表 ...

  5. CI集成phpunit Error: No code coverage driver is available 的解决

    CI集成phpunit时,运行报No code coverage driver is available的错误,如下图: yanglingdeMacBook-Pro:tests yangling$ p ...

  6. 代码覆盖率 (Code Coverage)从简到繁 (一)

    代码覆盖率(Code Coverage)是反映测试用例对被测软件覆盖程度的重要指标,也是衡量测试工作进展情况的重要指标.它也是对测试工作进行量化的重要指标之一,测试工作往往不如开发那样激动人心,一个重 ...

  7. Chrome DevTools: Export your raw Code Coverage Data

    The Code Coverage tool visually shows you which lines of code in your CSS and JavaScript are used an ...

  8. iOS 9 学习系列: Xcode Code Coverage

    Code coverage 是一个计算你的单元測试覆盖率的工具. 高水平的覆盖给你的单元測试带来信心.也表明你的应用被彻底的測试过了. 你可能写了几千个单元測试,但假设覆盖率不高.那么你写的这套測试可 ...

  9. Qt代码覆盖率code coverage(VS版)

    版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:Qt代码覆盖率code coverage(VS版)     本文地址:http://techi ...

随机推荐

  1. Centos7 hostname重启失效

    /etc/hosts  文件如下 [root@god ~]# more /etc/hosts 127.0.0.1 localhost ::1 localhost localhost.localdoma ...

  2. scala 打印一个乘法口诀表 (<<scala 编程>> P87)

    (for(i <- 1 to 9;j <- 1 to i; s = s"$j*$i=${i*j}\t") yield {if(j==1) s"$s\n&quo ...

  3. Leetcode 详解(valid plindrome)

    Question: Given a string, determine if it is a palindrome, considering only alphanumeric characters ...

  4. My97DatePickerBeta 日历插件

    <!doctype html><html lang="en"><head> <meta charset="UTF-8" ...

  5. Volley的GET和POST方法

    首先记得加上权限 <uses-permission android:name="android.permission.INTERNET"/> XML代码 <?xm ...

  6. hadoop分片分析

    上一篇分析了split的生成,现在接着来说具体的split具体内容及其相关的文件和类.以FileSplit(mapred包下org/apache/hadoop/mapreduce/lib/input/ ...

  7. 【 2013 Multi-University Training Contest 2 】

    HDU 4611 Balls Rearrangement 令lcm=LCM(a,b),gcd=GCD(a,b).cal(n,a,b)表示sum(abs(i%a-i%b)),0<=i<n. ...

  8. http Content-type对照表

    http://tools.jb51.net/table/http_content_type Content-Type,内容类型,一般是指网页中存在的Content-Type,用于定 义网络文件的类型和 ...

  9. C++小项目:directx11图形程序(五):shadersclass

    这个类是用来创建着色器并设置输入布局的. 这个类比较特殊,它创建的着色器与Effect文件有关,effect文件是用高级着色语言(hlsl)编写的. shadersclass.h #pragma on ...

  10. VS+VAssistX自动添加注释

    在VC6.0里边,C++函数头注释是使用一个宏完成的,VS系列中C#在函数头输入三个反斜杠也会自动生成XML格式的函数头注释. 又懒得在VS2008中写类似于添加函数头的注释,只能依靠一些工具了,今天 ...