Răsfoiți Sursa

* Implemented coCreateDeclaration

git-svn-id: trunk@22405 -
michael 13 ani în urmă
părinte
comite
fcb3d0c256
2 a modificat fișierele cu 8 adăugiri și 3 ștergeri
  1. 4 3
      packages/fcl-passrc/src/pastounittest.pp
  2. 4 0
      utils/pas2ut/pas2ut.pp

+ 4 - 3
packages/fcl-passrc/src/pastounittest.pp

@@ -36,7 +36,8 @@ Type
                          tNotify,     // Generate Property change notification test (tiOPF)
                          tMaxLen);    // Generate property MaxLen (tiOPF)
   TTestpropertyOptions = set of TTestpropertyOption;
-  TTestCodeOption = (coImplementation,  // generate (empty) implementation of tests
+  TTestCodeOption = (coCreateDeclaration, // Generate declaration of test cases. 
+                     coImplementation,  // generate (empty) implementation of tests
                      coDefaultFail,     // Insert Fail() statement in tests
                      coSingleClass,     // Use a single test class for all tests
                      coCreateUnit,      // Generate complete unit source
@@ -158,7 +159,7 @@ Type
 Const
   DefaultVisibilities    = [visDefault,visPublished,visPublic];
   DefaultPropertyOptions = [tDefault];
-  DefaultCodeOptions     = [coImplementation,coDefaultFail,coCreateUnit,
+  DefaultCodeOptions     = [coCreateDeclaration,coImplementation,coDefaultFail,coCreateUnit,
                             coSetup,coTearDown, coFunctions, coClasses,
                             coRegisterTests];
   DefaultMembers         = [tmtMethods,tmtFields,tmtProperties];
@@ -607,7 +608,7 @@ begin
       C.Add('');
       C.Add('Type');
       end;
-    If (coCreateUnit in CodeOptions) then
+    If (coCreateDeclaration in CodeOptions) then
       CreateInterfaceCode(C);
     if (coImplementation in CodeOptions) then
       begin

+ 4 - 0
utils/pas2ut/pas2ut.pp

@@ -35,6 +35,7 @@ Resourcestring
    SHelp80  = '--test-property-required generate a Required test for each property' ;
    SHelp90  = '--test-property-notify   generate a notify test for each property' ;
    SHelp100 = '--test-property-maxlen   generate a maxlen test for each property' ;
+   SHelp105 = '--skip-declaration       Do not generate declarations for the tests' ;
    SHelp110 = '--skip-implementation    Do not generate (empty) implementation for the tests' ;
    SHelp120 = '--skip-fail              Skip fail() statement in test implementations ' ;
    SHelp130 = '--skip-unit              Do not generate a unit' ;
@@ -172,6 +173,8 @@ begin
       op(tNotify,true)
     else if s='--test-property-maxlen' then
       op(tMaxLen,true)
+    else if s='--skip-declaration' then
+      oc(coCreateDeclaration,false)
     else if s='--skip-implementation' then
       oc(coImplementation,false)
     else if s='--skip-fail' then
@@ -276,6 +279,7 @@ begin
   Writeln(SHelp80 );
   Writeln(SHelp90 );
   Writeln(SHelp100);
+  Writeln(SHelp105);
   Writeln(SHelp110);
   Writeln(SHelp120);
   Writeln(SHelp130);