I have a Unit test project for my Application using DUnit framework.
This project have a unit surrounded by a $IFDEF
to output test-results in a xml file instead of the gui or just command line. XML_OUTPUT define is enabled by switching the Build configuration.
program DelphiCodeToDoc_Tests;
uses
TestFramework,
TextTestRunner,
Sysutils,
Forms,
GUITestRunner,
{$IFDEF XML_OUTPUT}
XmlTestRunner2 in 'DUnit_addon\XmlTestRunner2.pas',
{$ENDIF}
DCTDSetupTests in 'IntegrationTests\DCTDSetupTests.pas',
...
This works perfectly. The issue starts when I'm adding a new unit to this project from the IDE (a new unit with 'File>New>Unit').
The Test project is now :
uses
TestFramework,
TextTestRunner,
Sysutils,
Forms,
GUITestRunner,
DCTDSetupTests in 'IntegrationTests\DCTDSetupTests.pas',
...
MyNewUnit in 'IntegrationTests\MyNewUnit.pas';
As you see, the test XML_OUTPUT has disappeared ... Each time I'm adding a unit, Delphi IDE deletes this test.
Do you know why and how I can avoid it ?