RunActionExecute method

Applies to
TDUnitDialog

Declaration
Procedure RunActionExecute(Sender: TObject);

Implementation

procedure TDUnitDialog.RunActionExecute(Sender: TObject);
begin
  Assert(Suite <> nil);
  if FRunning then begin
    // warning: we're reentering this method if FRunning is true
    assert(FTestResult <> nil);
    FTestResult.stop;
    EXIT;
  end;

  RunButton.Caption := '&Stop';
  EnableUI(false);
  FRunning := true;
  try
    Setup;
    AutoSaveConfiguration;
    ClearResult;
    TestResult := TTestResult.create;
    try
      testResult.addListener(self);
      TestFramework.SetBreakOnFailures(BreakOnFailuresAction.Checked);
      TestTree.Items.BeginUpdate;
      try
        FSTartTime := now;
        suite.run(testResult);
      finally
        TestTree.Items.EndUpdate;
      end;
      if AutoFocusAction.Checked
      and not testResult.shouldStop then
      begin
        with CloseButton do
          if CanFocus then SetFocus;
      end
    finally
      testResult.Free;
      testResult := nil;
    end;
  finally
      FRunning := false;
      RunButton.Caption := '&Run';
      EnableUI(true);
  end;
End;


HTML generated by Time2HELP
http://www.time2help.com