<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: DUnit tricks: Getting stack traces for test failures</title>
	<atom:link href="http://blog.excastle.com/2008/04/13/dunit-tricks-getting-stack-traces-for-test-failures/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.excastle.com/2008/04/13/dunit-tricks-getting-stack-traces-for-test-failures/</link>
	<description>Life, .NET, and Cats</description>
	<pubDate>Sun, 27 Jul 2008 00:34:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Ajasja</title>
		<link>http://blog.excastle.com/2008/04/13/dunit-tricks-getting-stack-traces-for-test-failures/#comment-8418</link>
		<dc:creator>Ajasja</dc:creator>
		<pubDate>Fri, 25 Apr 2008 14:44:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/?p=2516#comment-8418</guid>
		<description>I did find a partial solution:
I use SendKeys (http://delphi.about.com/od/adptips2004/a/bltip1104_3.htm) to activate delphi and send CTRL+F12 (view  unit) and then the unit name + ENTER.

So the unit has to be part of the project, but otherwise it works quite nicely. I did have some problems with the editor losing focus, but the new version of DDevExtension (http://andy.jgknet.de/dspeedup/index.php?page=DDevExtensions) solves that. I do have the unit selector turned of though.
Not the most elegant, but it works

Here’s the code extract:
var
DelphiHandle : hwnd;

DelphiHandle:=FindWindow('TAppBuilder',nil);
AppActivate(DelphiHandle);
      SendKeys('^{F12}',true); //Ctrl+F12 is View  Unit
      SendKeys(Pchar(aUnitName),true); //look up unit name
      SendKeys('~',true); //enter

     SendKeys(Pchar('%g'),true); //Alt+G is the goto line dialog
     SendKeys(Pchar(IntTostr(aLineNum)),true); //send line
     SendKeys('~',true); //enter</description>
		<content:encoded><![CDATA[<p>I did find a partial solution:<br />
I use SendKeys (http://delphi.about.com/od/adptips2004/a/bltip1104_3.htm) to activate delphi and send CTRL+F12 (view  unit) and then the unit name + ENTER.</p>
<p>So the unit has to be part of the project, but otherwise it works quite nicely. I did have some problems with the editor losing focus, but the new version of DDevExtension (http://andy.jgknet.de/dspeedup/index.php?page=DDevExtensions) solves that. I do have the unit selector turned of though.<br />
Not the most elegant, but it works</p>
<p>Here’s the code extract:<br />
var<br />
DelphiHandle : hwnd;</p>
<p>DelphiHandle:=FindWindow(&#8217;TAppBuilder&#8217;,nil);<br />
AppActivate(DelphiHandle);<br />
      SendKeys(&#8217;^{F12}&#8217;,true); //Ctrl+F12 is View  Unit<br />
      SendKeys(Pchar(aUnitName),true); //look up unit name<br />
      SendKeys(&#8217;~',true); //enter</p>
<p>     SendKeys(Pchar(&#8217;%g&#8217;),true); //Alt+G is the goto line dialog<br />
     SendKeys(Pchar(IntTostr(aLineNum)),true); //send line<br />
     SendKeys(&#8217;~',true); //enter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://blog.excastle.com/2008/04/13/dunit-tricks-getting-stack-traces-for-test-failures/#comment-7982</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 22 Apr 2008 12:17:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/?p=2516#comment-7982</guid>
		<description>No, there doesn't seem to be a way to do that. Even if I compile with TD32 debug info, which is supposed to have even more info than the detailed .MAP file, I don't get file paths in the stack trace. And if those paths &lt;i&gt;were&lt;/i&gt; in the TD32 debug info, I'm pretty sure the JCL would be able to extract them.

You'll probably have to keep a list of directories to search through. There doesn't seem to be any better way.</description>
		<content:encoded><![CDATA[<p>No, there doesn&#8217;t seem to be a way to do that. Even if I compile with TD32 debug info, which is supposed to have even more info than the detailed .MAP file, I don&#8217;t get file paths in the stack trace. And if those paths <i>were</i> in the TD32 debug info, I&#8217;m pretty sure the JCL would be able to extract them.</p>
<p>You&#8217;ll probably have to keep a list of directories to search through. There doesn&#8217;t seem to be any better way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajasja</title>
		<link>http://blog.excastle.com/2008/04/13/dunit-tricks-getting-stack-traces-for-test-failures/#comment-7801</link>
		<dc:creator>Ajasja</dc:creator>
		<pubDate>Thu, 17 Apr 2008 11:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/?p=2516#comment-7801</guid>
		<description>Is it possible to get the full file name (file name + path) in the stack trace? 
It would be really nice, if one could just double click the failures and be taken to the exact line in the Delphi IDE. 
I'd like to add this to the TGUIRunner, but I just can't get the full file path.

Best regards, 
Ajasja</description>
		<content:encoded><![CDATA[<p>Is it possible to get the full file name (file name + path) in the stack trace?<br />
It would be really nice, if one could just double click the failures and be taken to the exact line in the Delphi IDE.<br />
I&#8217;d like to add this to the TGUIRunner, but I just can&#8217;t get the full file path.</p>
<p>Best regards,<br />
Ajasja</p>
]]></content:encoded>
	</item>
</channel>
</rss>
