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でカバレッジファイルを開くと、その結果に何も表示されません。
何間違っているかもしれませんか? 私はthis postの指示に従った。あなたは、あなたのプログラムを実行する必要が
ザム。なぜこれを簡単に文書化できなかったのですか? https://msdn.microsoft.com/en-us/library/dd299398(v=vs.90).aspx – granadaCoder
将来の読者のために........複数の.coverageファイルを作成する別の方法があります: http://stackoverflow.com/questions/415562/mstest-code-coverage/37005493#37005493 – granadaCoder