blob: 1a52a346028e20160c558bd379aa754a3e7e6458 [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Microsoft Visual Studio .NET usage recommendations</title>
<link rel="stylesheet" href="../../../style/style.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="../../index.html" title="Boost Test Library">
<link rel="up" href="../usage-recommendations.html" title="The unit test framework usage recommendations">
<link rel="prev" href="generic.html" title="Generic usage recommendations">
<link rel="next" href="command-line-specific.html" title="Command line usage recommendations">
<script language="JavaScript1.2" src="../../../js/boost-test.js"></script>
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table width="100%"><tr>
<td width="10%"><a href="../../index.html"><img alt="Home" width="229" height="61" border="0" src="../../../../../../libs/test/docbook/img/boost.test.logo.png"></a></td>
<td valign="middle" align="left"> &gt; <a href="../../utf.html">The Unit Test Framework</a> &gt; <a href="../usage-recommendations.html">Usage recommendations</a> &gt; <b>Microsoft Visual Studio .NET users specific</b>
</td>
<td><div class="spirit-nav">
<a href="generic.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a href="command-line-specific.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div></td>
</tr></table>
<hr>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="utf.usage-recommendations.dot-net-specific"></a>Microsoft Visual Studio .NET usage recommendations</h4></div></div></div>
<div class="qandaset">
<dl>
<dt> <a href="dot-net-specific.html#id663663">
Use custom build step to automatically start test program after compilation
</a>
</dt>
<dt> <a href="dot-net-specific.html#id663766">
If you got fatal exception somewhere within test case, make debugger break at the point the failure by adding
extra command line argument
</a>
</dt>
</dl>
<table border="0" summary="Q and A Set">
<col align="left" width="1%">
<tbody>
<tr class="question">
<td align="left" valign="top">
<a name="id663663"></a><a name="id663665"></a>
</td>
<td align="left" valign="top"><b><p>
Use custom build step to automatically start test program after compilation
</p></b></td>
</tr>
<tr class="answer">
<td align="left" valign="top"></td>
<td align="left" valign="top">
<p class="first-line-indented">
I found it most convenient to put test program execution as a post-build step in compilation. To do so use
project property page:
</p>
<div class="mediaobject"><img src="../../../img/post_build_event.jpg"></div>
<p class="first-line-indented">
Full command you need in "Command Line" field is:
</p>
<div class="cmdsynopsis"><p><code class="command">"$(TargetDir)\$(TargetName).exe"</code> --result_code=no --report_level=no </p></div>
<p class="first-line-indented">
Note that both report level and result code are suppressed. This way the only output you may see from this
command are possible runtime errors. But the best part is that you could jump through these errors using usual
keyboard shortcuts/mouse clicks you use for compilation error analysis:
</p>
<div class="mediaobject"><img src="../../../img/post_build_out.jpg"></div>
</td>
</tr>
<tr class="question">
<td align="left" valign="top">
<a name="id663766"></a><a name="id663768"></a>
</td>
<td align="left" valign="top"><b><p>
If you got fatal exception somewhere within test case, make debugger break at the point the failure by adding
extra command line argument
</p></b></td>
</tr>
<tr class="answer">
<td align="left" valign="top"></td>
<td align="left" valign="top">
<p class="first-line-indented">
If you got "memory access violation" message (or any other message indication fatal or system error) when you
run you test, to get more information of error location add --catch_system_errors=no to the test run command
line:
</p>
<div class="mediaobject"><img src="../../../img/run_args.jpg"></div>
<p class="first-line-indented">
Now run the test again under debugger and it will break at the point of failure.
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Gennadiy Rozental</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="generic.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../usage-recommendations.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="command-line-specific.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>