Ignore:
Timestamp:
Jan 2, 2025, 2:29:10 PM (5 days ago)
Author:
chronos
Message:
  • Modified: OK button moved to be on the left side of buttons.
  • Modified: Allow to run test from test form.
  • Fixed: Free tests during test list form close.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Forms/FormTest.pas

    r315 r365  
    44
    55uses
    6   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, FormEx;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, FormEx,
     7  TestCase;
    78
    89type
     
    1112
    1213  TFormTest = class(TFormEx)
     14    ButtonRun: TButton;
     15    ButtonClose: TButton;
    1316    MemoLog: TMemo;
     17    procedure FormShow(Sender: TObject);
     18    procedure ButtonRunClick(Sender: TObject);
     19  private
     20    FTestCase: TTestCase;
     21    procedure SetTestCase(AValue: TTestCase);
     22  public
     23    property TestCase: TTestCase read FTestCase write SetTestCase;
    1424  end;
    1525
     
    1929{$R *.lfm}
    2030
     31{ TFormTest }
     32
     33procedure TFormTest.FormShow(Sender: TObject);
     34begin
     35  if Assigned(FTestCase) then MemoLog.Text := FTestCase.Log;
     36end;
     37
     38procedure TFormTest.SetTestCase(AValue: TTestCase);
     39begin
     40  if FTestCase = AValue then Exit;
     41  FTestCase := AValue;
     42end;
     43
     44procedure TFormTest.ButtonRunClick(Sender: TObject);
     45begin
     46  if Assigned(FTestCase) then begin
     47    FTestCase.Run;
     48    MemoLog.Text := FTestCase.Log;
     49  end;
     50end;
     51
    2152end.
    2253
Note: See TracChangeset for help on using the changeset viewer.