testwit.lpr 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. program testwit;
  2. uses
  3. WIT.Model, WIT.Scanner, WIT.Parser,
  4. utcwitscanner, utcwitparser, utcwitmodel, utcrundirtests,
  5. consoletestrunner, testregistry;
  6. type
  7. { TTestRunner }
  8. TTestRunner = class(consoletestrunner.TTestRunner)
  9. function GetShortOpts: string; override;
  10. procedure AppendLongOpts; override;
  11. end;
  12. var
  13. Application : TTestRunner;
  14. { TTestRunner }
  15. function TTestRunner.GetShortOpts: string;
  16. begin
  17. Result:='d'+inherited GetShortOpts;
  18. end;
  19. procedure TTestRunner.AppendLongOpts;
  20. begin
  21. Inherited;
  22. LongOpts.Add('test-dir');
  23. end;
  24. begin
  25. DefaultFormat:=fPlain;
  26. DefaultRunAllTests:=True;
  27. Application:=TTestRunner.Create(Nil);
  28. Application.Initialize;
  29. if Application.HasOption('d','test-dir') then
  30. GetTestRegistry.AddTest(TDirectoryFileTests.CreateFromDir(Application.GetOptionValue('d','test-dir')));
  31. Application.Run;
  32. Application.Free;
  33. end.