What might cause the compiler not to generate console output

I have a DUnit project that will not compile as a Console if I add some units.
A project (dpr) is created by the wizard and defined CONSOLE_TESTRUNNER.

{$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.

Units that make this fail include some components of the VCL, but they do not run tests.
I even tried installing the Linker Option, but that didn't matter.
Has anyone encountered a similar problem?
Just to clarify: this is a Win32 project in Delphi 2010.

+5
source share
1 answer

This code is great for me. I can imagine two reasons why Delphi does not create a console application:

  • CONSOLE_TESTRUNNER not determined.
  • {$APPTYPE GUI} - .

, 2 .

+5

All Articles