4
我有以下C++代码。如何在命令行中使用MS代码覆盖工具?
#include <iostream>
using namespace std;
int testfunction(int input)
{
if (input > 0) {
return 1;
}
else {
return 0;
}
}
int main()
{
testfunction(-1);
testfunction(1);
}
我编译它得到执行
cl /Zi hello.cpp -link /Profile
然后,我的仪器的执行和产生的.coverage二进制文件。
vsinstr -coverage hello.exe
start vsperfmon -coverage -output:mytestrun.coverage
vsperfcmd -shutdown
当我在VS2010中打开coverage文件时,结果中什么都没有。
可能是什么问题? 我按照this post中的说明操作。
Zam。为什么MS不能很容易地记录它? https://msdn.microsoft.com/en-us/library/dd299398(v=vs.90).aspx – granadaCoder 2016-04-28 19:44:03