mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +02:00
fpcunit console test runner: patch from Michael van Canneyt (issue #12205)
* --format argument is case sensitive + Default Format can be configured in the application source (DefaultFormat variable). + Added a variable DefaultRunAllTests so if no --suite or no --all is specified on the command-line, --all is implicitly assumed. git-svn-id: trunk@16785 -
This commit is contained in:
parent
d8ca7e8a1b
commit
4486cb84cb
@ -35,6 +35,11 @@ const
|
|||||||
type
|
type
|
||||||
TFormat = (fPlain, fLatex, fXML);
|
TFormat = (fPlain, fLatex, fXML);
|
||||||
|
|
||||||
|
var
|
||||||
|
DefaultFormat : TFormat = fXML;
|
||||||
|
DefaultRunAllTests : Boolean = False;
|
||||||
|
|
||||||
|
type
|
||||||
{ TTestRunner }
|
{ TTestRunner }
|
||||||
|
|
||||||
TTestRunner = class(TCustomApplication)
|
TTestRunner = class(TCustomApplication)
|
||||||
@ -196,7 +201,7 @@ end;
|
|||||||
|
|
||||||
procedure TTestRunner.ParseOptions;
|
procedure TTestRunner.ParseOptions;
|
||||||
begin
|
begin
|
||||||
if HasOption('h', 'help') or (ParamCount = 0) then
|
if HasOption('h', 'help') or ((ParamCount = 0) and not DefaultRunAllTests) then
|
||||||
begin
|
begin
|
||||||
writeln(Title);
|
writeln(Title);
|
||||||
writeln(Version);
|
writeln(Version);
|
||||||
@ -219,13 +224,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
//get the format parameter
|
//get the format parameter
|
||||||
FormatParam := fXML;
|
FormatParam := DefaultFormat;
|
||||||
if HasOption('format') then
|
if HasOption('format') then
|
||||||
begin
|
begin
|
||||||
if GetOptionValue('format') = 'latex' then
|
if CompareText(GetOptionValue('format'),'latex')=0 then
|
||||||
FormatParam := fLatex
|
FormatParam := fLatex
|
||||||
else if GetOptionValue('format') = 'plain' then
|
else if CompareText(GetOptionValue('format'),'plain')=0 then
|
||||||
FormatParam := fPlain;
|
FormatParam := fPlain
|
||||||
|
else if CompareText(GetOptionValue('format'),'xml')=0 then
|
||||||
|
FormatParam := fXML;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ShowProgress := HasOption('p', 'progress');
|
ShowProgress := HasOption('p', 'progress');
|
||||||
@ -314,9 +321,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
//run the tests
|
//run the tests
|
||||||
if HasOption('a', 'all') then
|
|
||||||
DoTestRun(GetTestRegistry)
|
|
||||||
else
|
|
||||||
if HasOption('suite') then
|
if HasOption('suite') then
|
||||||
begin
|
begin
|
||||||
S := '';
|
S := '';
|
||||||
@ -327,7 +331,9 @@ begin
|
|||||||
else
|
else
|
||||||
for I := 0 to GetTestRegistry.Tests.count-1 do
|
for I := 0 to GetTestRegistry.Tests.count-1 do
|
||||||
CheckTestRegistry (GetTestregistry[I], S);
|
CheckTestRegistry (GetTestregistry[I], S);
|
||||||
end;
|
end
|
||||||
|
else if HasOption('a', 'all') or (DefaultRunAllTests and Not HasOption('l','list')) then
|
||||||
|
DoTestRun(GetTestRegistry) ;
|
||||||
Terminate;
|
Terminate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user