4

I have Delphi Seattle in place and I'm using DUnitX as my test framework. I noticed that it may have support for stacktrace. But I found no example or documentation about it. I found an inc file (DUnitX.Stacktrace.inc) where I can configure what I want to use as stacktrace provider. But, as I will not recompile it, because it comes along with Delphi.

How the best approach to enable it now ? When I have an error on tests setup etc. Will I get by default the stacktrace as well ?

Rodrigo Farias Rezino
  • 2,687
  • 3
  • 33
  • 60

1 Answers1

2

Copy the inc file into project folder, apply your changes and include it explicitly:

{$I DUnitX.Stacktrace.inc}

Actually you don't have to reference it directly (Delphi will search in project folder first anyway). Look at DUnitXTest.dproj for example (comes with Delphi in DUnitX\Tests folder). But i believe it is better to keep things obvious.

Andrei Galatyn
  • 3,322
  • 2
  • 24
  • 38
  • I did it and I added also an AV in order to see the stacktrace on screen, but no success. – Rodrigo Farias Rezino Mar 15 '18 at 10:57
  • @Rodrigo What do you mean "no success"? Put any text in first line of the INI - if compiler fails, then INI is in use. Then make sure that sourcecode of DUnitX is in search path (otherwise compiler will not be able to recompile). You can check it same way - add any text in first line of the unit, if compiler fails - than it rebuilds sourcecode and you can check in debugger to be sure that corresponding stack tracer is allowed. And of course you need to rebuild (not just recompile). – Andrei Galatyn Mar 15 '18 at 12:26
  • 1- yes, it's using the file, I made the test you told just to be sure. 2- Yes, added the DUnitX source code to search path, but for some reason I can't debug what looks like it's no "recompiling". 3- Then the result is, I get and error but the stacktrace is not displayed in the console screen – Rodrigo Farias Rezino Mar 15 '18 at 14:19