| 1 | <HTML> |
|---|
| 2 | <HEAD> |
|---|
| 3 | <TITLE>Boost Test Library msvc .net recommendations</TITLE> |
|---|
| 4 | <LINK rel="stylesheet" type="text/css" href="../style/btl.css" media="screen"> |
|---|
| 5 | <LINK rel="stylesheet" type="text/css" href="../style/btl-print.css" media="print"> |
|---|
| 6 | <META http-equiv="Content-Language" content="en-us"> |
|---|
| 7 | <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
|---|
| 8 | </HEAD> |
|---|
| 9 | <BODY> |
|---|
| 10 | <DIV class="header"> <A href="../index.html">Boost.Test</A> > <A href="recomendations.html"> Usage |
|---|
| 11 | recommendations </A> > <SPAN class="current_article">MSVC .NET</SPAN></DIV> |
|---|
| 12 | <DIV class="body"> <IMG src='../btl1.gif' width='252' height='43' alt="Boost Test logo"> |
|---|
| 13 | <H1 class="subtitle"><SPAN class="first-line-indented">Microsoft Visual Studio |
|---|
| 14 | .NET</SPAN> usage recommendations</H1> |
|---|
| 15 | <UL> |
|---|
| 16 | <LI><A href="#t1">Use custom build step to automatically start test program after compilation</A></LI> |
|---|
| 17 | <LI><A href="#t2">If you got fatal exception somewhere within test case, make debugger |
|---|
| 18 | break at the point the failure by adding extra command line argument</A></LI> |
|---|
| 19 | </UL> |
|---|
| 20 | <H5>Use custom build step to automatically start test program after compilation<A name="t1"></A></H5> |
|---|
| 21 | <P class="first-line-indented">I found it most convenient to put test program |
|---|
| 22 | execution as a post-build step in compilation. To do so use project property |
|---|
| 23 | page:</P> |
|---|
| 24 | <IMG src="imgs/post_build_event.jpg" alt="project property page" width="500" height="342"> |
|---|
| 25 | <P class="first-line-indented">Full command you need in "Command Line" field |
|---|
| 26 | is: </P> |
|---|
| 27 | <P class="first-line-indented"><u>"$(TargetDir)\$(TargetName).exe" --result_code=no |
|---|
| 28 | --report_level=no</u></P> |
|---|
| 29 | <P class="first-line-indented">Note that both report level and result code |
|---|
| 30 | are suppressed. This way the only output you may see from this command are |
|---|
| 31 | possible runtime errors. But the best part is that you could jump through |
|---|
| 32 | these errors using usual keyboard shortcuts/mouse clicks you use for compilation |
|---|
| 33 | error annalists:</P> |
|---|
| 34 | <P><IMG src="imgs/post_build_out.jpg" width="800" height="354"> |
|---|
| 35 | </P> |
|---|
| 36 | <H5>If you got fatal exception somewhere within test case, make debugger |
|---|
| 37 | break at the point the failure by adding extra command line argument<A name="t2"></A></H5> |
|---|
| 38 | <P class="first-line-indented">If you got "memory access violation" message |
|---|
| 39 | (or any other message indication fatal or system error) when you run |
|---|
| 40 | you test, to get more information of error location add --catch_system_errors=no |
|---|
| 41 | to the test run command line:</P> |
|---|
| 42 | <P class="first-line-indented"><IMG src="imgs/run_args.jpg" width="500" height="342"></P> |
|---|
| 43 | <P class="first-line-indented">Now run the test again under debugger and it will break at the point of failure. </P> |
|---|
| 44 | </DIV> |
|---|
| 45 | <DIV class="footer"> |
|---|
| 46 | <DIV class="footer-body"> |
|---|
| 47 | <P> © <A name="Copyright">Copyright</A> <A href='mailto:boost-test at emailaccount dot com (please unobscure)'>Gennadiy |
|---|
| 48 | Rozental</A> 2001-2005. <BR> |
|---|
| 49 | Distributed under the Boost Software License, Version 1.0. |
|---|
| 50 | (See accompanying file <A href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or |
|---|
| 51 | copy at <A href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</A>)</P> |
|---|
| 52 | <P>Revised: |
|---|
| 53 | <!-- #BeginDate format:Sw1 -->31 May, 2005<!-- #EndDate --> |
|---|
| 54 | </P> |
|---|
| 55 | </DIV> |
|---|
| 56 | </DIV> |
|---|
| 57 | </BODY> |
|---|
| 58 | </HTML> |
|---|