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. 从.NET平台调用Win32 API

    MSDN文章<Microsoft Win32 to Microsoft .NET Framework API Map> 介绍了.net 类库对win32的封装 从.NET平台调用Win32 ...

  2. [css3]跑马灯

    <div class="marquee"> <div> <p>纯CSS3生成的走马灯效果</p> <p>纯CSS3生成的 ...

  3. 【 2013 Multi-University Training Contest 6 】

    HDU 4655 Cut Pieces 假设n个数构成的总数都分成了n段,总数是n*a1*a2*...*an.但是答案显然不会那么多. 对于相邻的两个ai,ai+1,如果选择相同的颜色,那么就减少了a ...

  4. 【mysql】关于循环插入数据 存储设计

    要求插入的数据有一定的规律 新建实例列表 CREATE TABLE users ( userId ) NOT NULL, userName ) NOT NULL, Serves ) NOT NULL, ...

  5. IOS调用系统声音(键盘声音)

    #import <AudioToolbox/AudioToolbox.h> AudioServicesPlaySystemSound(1106); 注:括号中为系统声音的id,详见 htt ...

  6. hibernate 返回新插入数据的Id

    例如 表明 studentInfo String sql="set set nocount on studentInfo(列名,列名) values('值','值');select @@id ...

  7. JavaScript封装

    js封装就是把使用方式简单化,内部逻辑和使用解耦.使用人员知道参数和返回值就可以了,其他不用使用人员设置. 封装就是将属性,方法,字段等封装成类. JavaScript封装方法 1,函数方式 func ...

  8. Windows 8.1 with Update MSDN 简体/英文/繁体

    PS:请不要使用离线下载,以免镜像损坏! 1.CN: 文件名:cn_windows_8.1_enterprise_with_update_x64_dvd_4048578.isoSHA1:2D9BFE9 ...

  9. Perl技巧

    项目里面一直用的是Perl,Perl里有各种小技巧就分享在这吧. push(@a, $b) 把b元素压入a数组中, 还可以有 push(@a, [@b]); 那a就成了二维数组了 scalar(@a) ...

  10. goldengate studio 12.2.1.2.6发布

    主要特性: 1. 支持bigdata & teradata为目标端: