Initall commit
This commit is contained in:
79
FPCTests/fpcunitproject1.lpi
Normal file
79
FPCTests/fpcunitproject1.lpi
Normal file
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="fpcunitproject1"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<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="3">
|
||||
<Item1>
|
||||
<PackageName Value="fpcunittestrunner"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item3>
|
||||
</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="..\Source\Fasm4Delphi.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\Source"/>
|
||||
</SearchPaths>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
13
FPCTests/fpcunitproject1.lpr
Normal file
13
FPCTests/fpcunitproject1.lpr
Normal file
@@ -0,0 +1,13 @@
|
||||
program fpcunitproject1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Interfaces, Forms, GuiTestRunner, fpcunittestrunner, TestCase1;
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TGuiTestRunner, TestRunner);
|
||||
Application.Run;
|
||||
end.
|
||||
|
||||
40
FPCTests/fpcunitproject1.lps
Normal file
40
FPCTests/fpcunitproject1.lps
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="10"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="fpcunitproject1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<CursorPos X="66" Y="6"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestCase1"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="21"/>
|
||||
<CursorPos X="62" Y="41"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\Source\Fasm4Delphi.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="-1"/>
|
||||
<TopLine Value="-1"/>
|
||||
<CursorPos X="-1" Y="-1"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
<General>
|
||||
<ActiveWindowIndexAtStart Value="-1"/>
|
||||
</General>
|
||||
<JumpHistory HistoryIndex="-1"/>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
||||
51
FPCTests/testcase1.pas
Normal file
51
FPCTests/testcase1.pas
Normal file
@@ -0,0 +1,51 @@
|
||||
unit TestCase1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testutils, testregistry,Fasm4Delphi;
|
||||
|
||||
type
|
||||
|
||||
TTestCase1= class(TTestCase)
|
||||
published
|
||||
procedure TestHookUp;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
CompliterMemSize=$10000;
|
||||
|
||||
var
|
||||
CompliterMem:PFASM_STATE;
|
||||
|
||||
procedure TTestCase1.TestHookUp;
|
||||
begin
|
||||
if fasm_AssembleFile('..\Tests\Test1.asm',CompliterMem,CompliterMemSize)<>FASM_OK then
|
||||
Fail('Error in test1:'+sLineBreak+
|
||||
'Condition: '+CompliterMem^.condition.ToString+sLineBreak+
|
||||
'Error Code: '+CompliterMem^.error_code.ToString);
|
||||
if fasm_Assemble('add eax,0',CompliterMem,CompliterMemSize)<>FASM_OK then
|
||||
writeln('Error in test2:'+sLineBreak+
|
||||
'Condition: '+CompliterMem^.condition.ToString+sLineBreak+
|
||||
'Error Code: '+CompliterMem^.error_code.ToString);
|
||||
if fasm_AssembleFile('..\FasmDll\FASM.ASH',CompliterMem,CompliterMemSize)=FASM_OK then
|
||||
Fail('Error in test3:'+sLineBreak+
|
||||
'FASM is compiling something that it is can not compile at all.');
|
||||
if fasm_Assemble('call -100',CompliterMem,CompliterMemSize)<>FASM_OK then
|
||||
Fail('Error in test4:'+sLineBreak+
|
||||
'Condition: '+CompliterMem^.condition.ToString+sLineBreak+
|
||||
'Error Code: '+CompliterMem^.error_code.ToString);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
initialization
|
||||
LoadFASM('..\FasmDll\FASM.DLL');
|
||||
GetMem(CompliterMem,CompliterMemSize);
|
||||
RegisterTest(TTestCase1);
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user