Final Delphi+part of FPC
This commit is contained in:
76
FPCTest/fpcunitproject1.lpi
Normal file
76
FPCTest/fpcunitproject1.lpi
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="fpcunitproject1"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="fpcunitproject1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestCase1"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="fpcunitproject1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value=".."/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<TargetCPU Value="jvm"/>
|
||||
</CodeGeneration>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
25
FPCTest/fpcunitproject1.lpr
Normal file
25
FPCTest/fpcunitproject1.lpr
Normal file
@@ -0,0 +1,25 @@
|
||||
program fpcunitproject1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Classes, consoletestrunner, TestCase1;
|
||||
|
||||
type
|
||||
|
||||
{ TMyTestRunner }
|
||||
|
||||
TMyTestRunner = class(TTestRunner)
|
||||
protected
|
||||
// override the protected methods of TTestRunner to customize its behavior
|
||||
end;
|
||||
|
||||
var
|
||||
Application: TMyTestRunner;
|
||||
|
||||
begin
|
||||
Application := TMyTestRunner.Create(nil);
|
||||
Application.Initialize;
|
||||
Application.Run;
|
||||
Application.Free;
|
||||
end.
|
||||
90
FPCTest/fpcunitproject1.lps
Normal file
90
FPCTest/fpcunitproject1.lps
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="10"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="6">
|
||||
<Unit0>
|
||||
<Filename Value="fpcunitproject1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="-1"/>
|
||||
<TopLine Value="-1"/>
|
||||
<CursorPos X="-1" Y="-1"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestCase1"/>
|
||||
<CursorPos X="98" Y="24"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<CursorPos X="89" Y="25"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\wininc\redef.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="14"/>
|
||||
<CursorPos X="29" Y="30"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\wininc\base.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="636"/>
|
||||
<CursorPos X="6" Y="652"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="C:\lazarus\packager\registration\fcllaz.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<CursorPos X="3" Y="11"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit5>
|
||||
</Units>
|
||||
<JumpHistory Count="8" HistoryIndex="7">
|
||||
<Position1>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="31" Column="6" TopLine="15"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="31" Column="6" TopLine="15"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="33" Column="20" TopLine="17"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="25" Column="89"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="31" Column="5" TopLine="15"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="38" Column="2" TopLine="21"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="12" Column="50"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="24" Column="98"/>
|
||||
</Position8>
|
||||
</JumpHistory>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
||||
53
FPCTest/testcase1.pas
Normal file
53
FPCTest/testcase1.pas
Normal file
@@ -0,0 +1,53 @@
|
||||
unit TestCase1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testutils, testregistry, AG.Logs;
|
||||
|
||||
type
|
||||
|
||||
TTestCase1= class(TTestCase)
|
||||
published
|
||||
procedure TestHookUp;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
procedure TTestCase1.TestHookUp;
|
||||
var
|
||||
MultiLog:TAGLog;
|
||||
Stream:TStream;
|
||||
s:TBytes;
|
||||
begin
|
||||
MultiLog:=TAGMultiLog.Create(nil);
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGNullLog.Create());
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGDiskLog.Create('test.log'));
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGRamLog.Create());
|
||||
{$IFNDEF MSWINDOWS}(MultiLog as TAGMultiLog).Logs.Add(TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE))){$ENDIF};
|
||||
try
|
||||
//s:=TFile.ReadAllBytes('test2.log');
|
||||
except
|
||||
//s:=TBytes.Create();
|
||||
end;
|
||||
Stream:=TFileStream.Create('test2.log',fmCreate+fmOpenReadWrite+fmShareDenyWrite);
|
||||
Stream.WriteBuffer(s,length(s));
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGStreamLog.Create(Stream));
|
||||
{(MultiLog as TAGMultiLog).Logs.Add(TAGCallBackLog.Create(procedure(s:string)
|
||||
begin
|
||||
Self.WriteLn(s);
|
||||
end));}
|
||||
MultiLog.Write('Str Test');
|
||||
MultiLog.Write('Str+Object Test',self);
|
||||
FreeAndNil(MultiLog);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
initialization
|
||||
|
||||
RegisterTest(TTestCase1);
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user