I have a DUnit project that won't compile as Console if I add some units.
The Project (dpr) is created by the Wizard and CONSOLE_TESTRUNNER
is defined.
{$IFDEF CONSOLE_TESTRUNNER}
{$APPTYPE CONSOLE}
{$ENDIF}
begin
Application.Initialize;
if IsConsole then // <-- IsConsole is set to False.
with TextTestRunner.RunRegisteredTests do
Free
else
GUITestRunner.RunRegisteredTests;
end.
The units that make it fail include some VCL components but no tests are run on them.
I've even tried to set the Linker Option but it made no difference.
Did someone experience a similar issue?
Just for clarification: This project is Win32 in Delphi 2010.
That code works just fine for me. I can think of two reasons why Delphi is not producing a console app:
CONSOLE_TESTRUNNER
is not defined.{$APPTYPE GUI}
somewhere in your project's code.I'm reasonably confident that item 2 above is the reason for your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With