Przeglądaj źródła

+ support for specifying an optional command line parameter to use during a
recompile of a test

git-svn-id: trunk@26955 -

Jonas Maebe 11 lat temu
rodzic
commit
4f1207f603
3 zmienionych plików z 14 dodań i 6 usunięć
  1. 3 1
      tests/readme.txt
  2. 5 3
      tests/utils/dotest.pp
  3. 6 2
      tests/utils/testu.pp

+ 3 - 1
tests/readme.txt

@@ -88,7 +88,9 @@ DELFILES...........List of files (separated by spaces) to be deleted after
 GRAPH..............Requires graph unit
 GRAPH..............Requires graph unit
 FAIL...............Compilation must fail
 FAIL...............Compilation must fail
 RECOMPILE..........After compiling a test, recompile the test for a second
 RECOMPILE..........After compiling a test, recompile the test for a second
-                   time. This is needed to test ppu loading issues.
+                   time. This is needed to test ppu loading issues. Can
+		   optionally specify a command line option to use only
+		   during the second compilation.
 NORUN..............Do not execute test, only compile it
 NORUN..............Do not execute test, only compile it
 INTERACTIVE........Do not execute test, as it requires user intervention
 INTERACTIVE........Do not execute test, as it requires user intervention
 NOTE...............Output note when compiling/executing test
 NOTE...............Output note when compiling/executing test

+ 5 - 3
tests/utils/dotest.pp

@@ -911,7 +911,7 @@ begin
   DelOptions:=opts;
   DelOptions:=opts;
 end;
 end;
 
 
-function RunCompiler:boolean;
+function RunCompiler(const ExtraPara: string):boolean;
 var
 var
   args,LocalExtraArgs,
   args,LocalExtraArgs,
   wpoargs : string;
   wpoargs : string;
@@ -923,6 +923,8 @@ var
 begin
 begin
   RunCompiler:=false;
   RunCompiler:=false;
   args:='-n -T'+CompilerTarget+' -Fu'+RTLUnitsDir;
   args:='-n -T'+CompilerTarget+' -Fu'+RTLUnitsDir;
+  if ExtraPara<>'' then
+    args:=args+' '+ExtraPara;
   { the helper object files have been copied to the common directory }
   { the helper object files have been copied to the common directory }
   if UniqueSuffix<>'' then
   if UniqueSuffix<>'' then
     args:=args+' -Fo'+TestOutputDir+'/..';
     args:=args+' -Fo'+TestOutputDir+'/..';
@@ -2000,9 +2002,9 @@ begin
 
 
   if Res then
   if Res then
    begin
    begin
-     Res:=RunCompiler;
+     Res:=RunCompiler('');
      if Res and Config.NeedRecompile then
      if Res and Config.NeedRecompile then
-      Res:=RunCompiler;
+      Res:=RunCompiler(Config.RecompileOpt);
    end;
    end;
 
 
   if Res and (not Config.ShouldFail) then
   if Res and (not Config.ShouldFail) then

+ 6 - 2
tests/utils/testu.pp

@@ -23,7 +23,8 @@ type
     MinVersion,
     MinVersion,
     MaxVersion,
     MaxVersion,
     KnownRunNote,
     KnownRunNote,
-    KnownCompileNote : string;
+    KnownCompileNote,
+    RecompileOpt: string;
     ResultCode    : longint;
     ResultCode    : longint;
     KnownRunError : longint;
     KnownRunError : longint;
     KnownCompileError : longint;
     KnownCompileError : longint;
@@ -211,7 +212,10 @@ begin
                 r.ShouldFail:=true
                 r.ShouldFail:=true
               else
               else
                if GetEntry('RECOMPILE') then
                if GetEntry('RECOMPILE') then
-                r.NeedRecompile:=true
+	        begin
+                  r.NeedRecompile:=true;
+		  r.RecompileOpt:=res;
+		end
               else
               else
                if GetEntry('NORUN') then
                if GetEntry('NORUN') then
                 r.NoRun:=true
                 r.NoRun:=true