I just hacked a sample that works both in DUnit (delphi) and in FPCUnit (the Freepascal equivalent closest to DUnit, which is already sent "to the field" in lazarus 1.0, which includes freepascal 2.6):
The trivial bit of IFDEF, and you're there.
unit TestUnit1; {$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF} interface uses Classes, {$ifdef FPC} fpcunit, testutils, testregistry, {$else} TestFramework, {$endif} SysUtils; type TTestCase1= class(TTestCase) published procedure TestHookUp; end; implementation procedure TTestCase1.TestHookUp; begin Self.Check(false,'value'); end; initialization RegisterTest(TTestCase1{$ifndef FPC}.Suite{$endif}); end.
Warren p
source share