Skip to content

(TestRunner.pas) Updated TestRunner.pas to work with FPC and Blaise - #34

Open
Schmitty2005 wants to merge 1 commit into
graemeg:masterfrom
Schmitty2005:master
Open

(TestRunner.pas) Updated TestRunner.pas to work with FPC and Blaise #34
Schmitty2005 wants to merge 1 commit into
graemeg:masterfrom
Schmitty2005:master

Conversation

@Schmitty2005

Copy link
Copy Markdown

The TestRunner.pas file has been updated to work with FPC and Blaise compiler. This is what the new TestRunner.pas looks like :

program TestRunner;

{$IFDEF FPC}
{$mode objfpc}{$H+}
uses
  Classes, SysUtils, fpcunit, testregistry, consoletestrunner;
{$ENDIF}

{$IFDEF BLAISE}
uses blaise.testing, blaise.testing.runner.text;
{$ENDIF}

type
  { Sample test case - replace with your actual tests }
  TSampleTest = class(TTestCase)
  published
    procedure TestExample;
  end;

procedure TSampleTest.TestExample;
begin
  AssertEquals('Sample test', 2, 1 + 1);
end;

{$IFDEF FPC}
var
  Application: TTestRunner;

begin
  Application := TTestRunner.Create(nil);
  try
    RegisterTest(TSampleTest);
    Application.Initialize;
    Application.Run;
  finally
    Application.Free;
  end;
end.
{$ENDIF}

{$IFDEF BLAISE}
begin
  RegisterTest(TSampleTest);  
  Halt(RunAll());
end.
{$ENDIF}

pasbuild test and pasbuild compile were run on the PasBuild source as well as a simple pasbuild init project. All is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant