Reputation: 106530
I have some unit tests in a Google Test project. I want to run these tests as part of my msbuild script. I've added the following to my vcxproj
file:
<Target Name="AfterBuild">
<Exec Command=""$(TargetPath)""
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true"
CustomWarningRegularExpression=": error:"/>
</Target>
Unfortunately, since there are no inputs or outputs for Exec
, it only runs once, and never causes the vcxproj
itself to be marked out of date.
How can I force this Exec
to always be out of date (so that it runs every build)?
Upvotes: 2
Views: 308
Reputation: 1328
You can add DependsOnTargets
attribute w/ dependency on the vcxproj
that contains code to be tested. That way, each time the code is updated and built, your unit tests will execute.
Upvotes: 1