delphimvcframework/unittests/general/Several/DMVCFrameworkTests.dpr

135 lines
6.1 KiB
ObjectPascal
Raw Normal View History

program DMVCFrameworkTests;
2021-02-04 14:11:33 +01:00
{$IFDEF CONSOLE_TESTRUNNER}
{$APPTYPE CONSOLE}
2021-02-04 14:11:33 +01:00
{$ENDIF}
{$STRONGLINKTYPES ON}
2016-08-24 16:08:18 +02:00
2021-03-04 14:29:13 +01:00
uses
System.SysUtils,
DUnitX.TestFramework,
2021-04-05 19:35:46 +02:00
{$IFDEF CONSOLE_TESTRUNNER}
2021-02-04 14:11:33 +01:00
DUnitX.Loggers.Console,
2021-04-05 19:35:46 +02:00
{$ENDIF }
{$IFDEF TESTINSIGHT}
2021-02-04 14:11:33 +01:00
TestInsight.DUnitX,
2021-04-05 19:35:46 +02:00
{$ENDIF }
FrameworkTestsU in 'FrameworkTestsU.pas',
LiveServerTestU in 'LiveServerTestU.pas',
BOs in 'BOs.pas',
TestServerControllerU in '..\TestServer\TestServerControllerU.pas',
RESTAdapterTestsU in 'RESTAdapterTestsU.pas',
2021-04-05 19:35:46 +02:00
MVCFramework.Tests.WebModule1 in '..\RESTClient\MVCFramework.Tests.WebModule1.pas' {TestWebModule1: TWebModule},
MVCFramework.Tests.RESTClient in '..\RESTClient\MVCFramework.Tests.RESTClient.pas',
2017-02-07 14:08:36 +01:00
MVCFramework.Tests.AppController in '..\RESTClient\MVCFramework.Tests.AppController.pas',
2017-04-26 14:39:18 +02:00
BusinessObjectsU in '..\..\..\samples\commons\BusinessObjectsU.pas',
2017-05-25 16:57:49 +02:00
MVCFramework.SystemJSONUtils in '..\..\..\sources\MVCFramework.SystemJSONUtils.pas',
MVCFramework.Serializer.Commons in '..\..\..\sources\MVCFramework.Serializer.Commons.pas',
2017-09-24 19:40:40 +02:00
MVCFramework.Patches in '..\..\..\sources\MVCFramework.Patches.pas',
JSONRPCTestsU in 'JSONRPCTestsU.pas',
MVCFramework.JSONRPC in '..\..\..\sources\MVCFramework.JSONRPC.pas',
RandomUtilsU in '..\..\..\samples\commons\RandomUtilsU.pas',
MVCFramework.Serializer.JsonDataObjects in '..\..\..\sources\MVCFramework.Serializer.JsonDataObjects.pas',
JsonDataObjects in '..\..\..\sources\JsonDataObjects.pas',
Serializers.JsonDataObjectsTestU in 'Serializers.JsonDataObjectsTestU.pas',
MVCFramework.Tests.Serializer.Entities in '..\..\common\MVCFramework.Tests.Serializer.Entities.pas',
2021-04-05 19:35:46 +02:00
MVCFramework.Tests.Serializer.EntitiesModule in '..\..\common\MVCFramework.Tests.Serializer.EntitiesModule.pas' {EntitiesModule: TDataModule},
MVCFramework.Tests.Serializer.Intf in '..\..\common\MVCFramework.Tests.Serializer.Intf.pas',
2021-04-05 19:35:46 +02:00
MVCFramework.Serializer.JsonDataObjects.OptionalCustomTypes in '..\..\..\sources\MVCFramework.Serializer.JsonDataObjects.OptionalCustomTypes.pas',
2020-05-27 11:28:22 +02:00
ActiveRecordTestsU in 'ActiveRecordTestsU.pas',
TestConstsU in 'TestConstsU.pas',
2020-09-12 03:24:38 +02:00
MVCFramework.RESTClient.Indy in '..\..\..\sources\MVCFramework.RESTClient.Indy.pas',
MVCFramework.RESTClient.Intf in '..\..\..\sources\MVCFramework.RESTClient.Intf.pas',
MVCFramework.RESTClient.Commons in '..\..\..\sources\MVCFramework.RESTClient.Commons.pas',
MVCFramework.RESTClient in '..\..\..\sources\MVCFramework.RESTClient.pas',
PGUtilsU in 'PGUtilsU.pas',
MVCFramework.ActiveRecord in '..\..\..\sources\MVCFramework.ActiveRecord.pas',
2021-02-04 14:11:33 +01:00
MVCFramework.ActiveRecordController in '..\..\..\sources\MVCFramework.ActiveRecordController.pas',
ActiveRecordControllerTestU in 'ActiveRecordControllerTestU.pas',
ActiveRecordControllerWebModuleU in 'webmodules\ActiveRecordControllerWebModuleU.pas' {ActiveRecordControllerWebModule: TWebModule},
FDConnectionConfigU in '..\..\common\FDConnectionConfigU.pas',
StandaloneServerTestU in 'StandaloneServerTestU.pas',
StandAloneServerWebModuleTest in 'webmodules\StandAloneServerWebModuleTest.pas' {TestWebModule2: TWebModule},
MVCFramework.Commons in '..\..\..\sources\MVCFramework.Commons.pas',
2021-04-05 19:35:46 +02:00
MVCFramework.Serializer.JsonDataObjects.CustomTypes in '..\..\..\sources\MVCFramework.Serializer.JsonDataObjects.CustomTypes.pas',
MVCFramework.SQLGenerators.Firebird in '..\..\..\sources\MVCFramework.SQLGenerators.Firebird.pas',
MVCFramework.Utils in '..\..\..\sources\MVCFramework.Utils.pas',
MVCFramework.SQLGenerators.Interbase in '..\..\..\sources\MVCFramework.SQLGenerators.Interbase.pas',
MVCFramework.SQLGenerators.MSSQL in '..\..\..\sources\MVCFramework.SQLGenerators.MSSQL.pas',
MVCFramework.SQLGenerators.MySQL in '..\..\..\sources\MVCFramework.SQLGenerators.MySQL.pas',
MVCFramework.SQLGenerators.PostgreSQL in '..\..\..\sources\MVCFramework.SQLGenerators.PostgreSQL.pas',
MVCFramework.SQLGenerators.Sqlite in '..\..\..\sources\MVCFramework.SQLGenerators.Sqlite.pas',
MVCFramework.RQL.AST2FirebirdSQL in '..\..\..\sources\MVCFramework.RQL.AST2FirebirdSQL.pas',
MVCFramework.RQL.AST2InterbaseSQL in '..\..\..\sources\MVCFramework.RQL.AST2InterbaseSQL.pas',
MVCFramework.RQL.AST2MSSQL in '..\..\..\sources\MVCFramework.RQL.AST2MSSQL.pas',
MVCFramework.RQL.AST2MySQL in '..\..\..\sources\MVCFramework.RQL.AST2MySQL.pas',
MVCFramework.RQL.AST2PostgreSQL in '..\..\..\sources\MVCFramework.RQL.AST2PostgreSQL.pas',
MVCFramework.RQL.AST2SQLite in '..\..\..\sources\MVCFramework.RQL.AST2SQLite.pas',
MVCFramework.RQL.Parser in '..\..\..\sources\MVCFramework.RQL.Parser.pas',
Entities in 'Entities.pas',
EntitiesProcessors in 'EntitiesProcessors.pas',
MVCFramework.Nullables in '..\..\..\sources\MVCFramework.Nullables.pas';
{$R *.RES}
2021-02-04 14:11:33 +01:00
{$IFDEF CONSOLE_TESTRUNNER}
2021-03-04 14:29:13 +01:00
procedure MainConsole();
var
runner: ITestRunner;
results: IRunResults;
logger: ITestLogger;
begin
try
// Check command line options, will exit if invalid
TDUnitX.CheckCommandLine;
// Create the test runner
runner := TDUnitX.CreateRunner;
// Tell the runner to use RTTI to find Fixtures
runner.UseRTTI := True;
// tell the runner how we will log things
// Log to the console window
logger := TDUnitXConsoleLogger.Create(True);
runner.AddLogger(logger);
// Generate an NUnit compatible XML File
// nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile);
// runner.AddLogger(nunitLogger);
runner.FailsOnNoAsserts := False; // When true, Assertions must be made during tests;
// Run tests
results := runner.Execute;
if not results.AllPassed then
System.ExitCode := EXIT_ERRORS;
2016-08-24 16:08:18 +02:00
{$IFNDEF CI}
// We don't want this happening when running under CI.
if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then
begin
System.Write('Done.. press <Enter> key to quit.');
System.Readln;
end;
{$ENDIF}
except
on E: Exception do
System.Writeln(E.ClassName, ': ', E.Message);
end;
end;
{$ENDIF}
2021-03-04 14:29:13 +01:00
begin
ReportMemoryLeaksOnShutdown := True;
2021-02-04 14:11:33 +01:00
{$IF Defined(CONSOLE_TESTRUNNER)}
MainConsole();
2021-03-04 14:29:13 +01:00
{$ELSE}
{$IF Defined(TESTINSIGHT)}
2021-02-04 14:11:33 +01:00
TestInsight.DUnitX.RunRegisteredTests();
2021-03-04 14:29:13 +01:00
{$ELSE}
raise Exception.Create('No Runner defined');
{$ENDIF}
{$ENDIF}
end.