Sha256: c587d7dfa4855960ee15f8e52ce190df085bafb77fd9cc809ece9c6009e8be30

Contents?: true

Size: 1.58 KB

Versions: 283

Compression:

Stored size: 1.58 KB

Contents

program Grains;

{$IFNDEF TESTINSIGHT}
{$APPTYPE CONSOLE}
{$ENDIF}{$STRONGLINKTYPES ON}
uses
  System.SysUtils,
  {$IFDEF TESTINSIGHT}
  TestInsight.DUnitX,
  {$ENDIF }
  DUnitX.Loggers.Console,
  DUnitX.Loggers.Xml.NUnit,
  DUnitX.TestFramework,
  uGrainsTests in 'uGrainsTests.pas',
  uGrains in 'uGrains.pas';

var
  runner : ITestRunner;
  results : IRunResults;
  logger : ITestLogger;
  nunitLogger : ITestLogger;
begin
{$IFDEF TESTINSIGHT}
  TestInsight.DUnitX.RunRegisteredTests;
  exit;
{$ENDIF}
  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;

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

Version data entries

283 entries across 283 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.158 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.157 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.156 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.155 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.154 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.153 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.152 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.151 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.150 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.149 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.148 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.147 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.146 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.145 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.144 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.143 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.142 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.141 tracks/delphi/exercises/grains/Grains.dpr
trackler-2.2.1.140 tracks/delphi/exercises/grains/Grains.dpr