How to use MS code coverage tool in command line?

I have the following C++ code.

#include 
using namespace std;

int testfunction(int input)
{
    if (input > 0) {
        return 1;
    }
    else {
        return 0;
    }
}

int main()
{
    testfunction(-1);
    testfunction(1);
}

I compiled it to get the execution

cl /Zi hello.cpp -link /Profile

Then, I instrument the execution and generated the .coverage binary.

vsinstr -coverage hello.exe
start vsperfmon -coverage -output:mytestrun.coverage
vsperfcmd -shutdown

When I open the coverage file in VS2010, I got nothing in its results.

enter image description here

What might be wrong? Я выполнил инструкции из этого сообщения .

6
задан Stefan Steinegger 15 March 2013 в 06:39
поделиться