Browse Source

Fix failure for windows make, related to the use of redirection,
which on mingw32 make generate the use of a batch file, incompatible with
forward slashes usd for createlst and gparmake.

* utils/createlst.pp:
Modify to add a first parameter with the name of the output file.

Makefile.fpc: Adapt to new parameter of createlst.
Change list name for directory TEST from TESTfilelist.lst to filelistTEST.lst
to avoid generating files that start as the directory.

git-svn-id: trunk@34328 -

pierre 9 years ago
parent
commit
05542fbed9
2 changed files with 53 additions and 24 deletions
  1. 10 10
      tests/Makefile.fpc
  2. 43 14
      tests/utils/createlst.pp

+ 10 - 10
tests/Makefile.fpc

@@ -527,16 +527,16 @@ $(MAKEINC): $(GPARMAKE) $(CREATELST)
 # new call with a gap insuring that all the previous files have lower index
 # new call with a gap insuring that all the previous files have lower index
 # even if CHUNKSIZE is equal to 1.
 # even if CHUNKSIZE is equal to 1.
 	$(Q)$(MAKE) $(TEST_OUTPUTDIR)
 	$(Q)$(MAKE) $(TEST_OUTPUTDIR)
-	$(Q)$(CREATELST) $(TESTDIRS) > testfilelist.lst
-	$(Q)$(GPARMAKE) $(MAKEINC) test 1 $(CHUNKSIZE) @testfilelist.lst
-	$(Q)$(CREATELST) tbs > tbsfilelist.lst
-	$(Q)$(GPARMAKE) -a $(MAKEINC) tbs 10000 $(CHUNKSIZE) @tbsfilelist.lst
-	$(Q)$(CREATELST) tbf > tbffilelist.lst
-	$(Q)$(GPARMAKE) -a $(MAKEINC) tbf 15000 $(CHUNKSIZE) @tbffilelist.lst
-	$(Q)$(CREATELST) webtbs > webtbsfilelist.lst
-	$(Q)$(GPARMAKE) -a $(MAKEINC) webtbs 20000 $(CHUNKSIZE) @webtbsfilelist.lst
-	$(Q)$(CREATELST) webtbf > webtbffilelist.lst
-	$(Q)$(GPARMAKE) -a $(MAKEINC) webtbf 30000 $(CHUNKSIZE) @webtbffilelist.lst
+	$(CREATELST) filelisttest.lst $(TESTDIRS)
+	$(GPARMAKE) $(MAKEINC) test 1 $(CHUNKSIZE) @filelisttest.lst
+	$(CREATELST) filelisttbs.lst tbs
+	$(GPARMAKE) -a $(MAKEINC) tbs 10000 $(CHUNKSIZE) @filelisttbs.lst
+        $(CREATELST) filelisttbf.lst tbf
+	$(GPARMAKE) -a $(MAKEINC) tbf 15000 $(CHUNKSIZE) @filelisttbf.lst
+        $(CREATELST) filelistwebtbs.lst webtbs
+	$(GPARMAKE) -a $(MAKEINC) webtbs 20000 $(CHUNKSIZE) @filelistwebtbs.lst
+        $(CREATELST) filelistwebtbf.lst webtbf
+	$(GPARMAKE) -a $(MAKEINC) webtbf 30000 $(CHUNKSIZE) @filelistwebtbf.lst
 
 
 
 
 # only include the targets to compile/run the tests when we want to
 # only include the targets to compile/run the tests when we want to

+ 43 - 14
tests/utils/createlst.pp

@@ -4,32 +4,61 @@ uses
   SysUtils, Classes;
   SysUtils, Classes;
 
 
 var
 var
-  i: LongInt;
+  i,ioerror : LongInt;
+  outfile : text;
   sr: TSearchRec;
   sr: TSearchRec;
   path: String;
   path: String;
   sl: TStringList;
   sl: TStringList;
 begin
 begin
-  if ParamCount = 0 then begin
-    Writeln('createlst PATH [PATH [...]]');
-    Exit;
-  end;
+  if ParamCount < 2 then
+    begin
+      Writeln('createlst OUTPUTFILE PATH [PATH [...]]');
+      Halt(1);
+    end;
 
 
   sl := TStringList.Create;
   sl := TStringList.Create;
 
 
-  for i := 1 to ParamCount do begin
-    path := IncludeTrailingPathDelimiter(ParamStr(i));
-    if FindFirst(path + 't*.pp', 0, sr) = 0 then begin
-      repeat
-        sl.Add(path + sr.Name);
-      until FindNext(sr) <> 0;
+{$i-}
+  assign(outfile,paramstr(1));
+  rewrite(outfile);
+  ioerror:=IOResult;
+
+  if ioerror<>0 then
+    begin
+      Writeln('Rewrite(',ParamStr(1),') failed, IOResult=',ioerror);
+      Halt(2);
+    end;
 
 
-      FindClose(sr);
+  for i := 2 to ParamCount do
+    begin
+      path := IncludeTrailingPathDelimiter(ParamStr(i));
+      if FindFirst(path + 't*.pp', 0, sr) = 0 then
+        begin
+          repeat
+            sl.Add(path + sr.Name);
+          until FindNext(sr) <> 0;
+          FindClose(sr);
+        end;
     end;
     end;
-  end;
 
 
   sl.Sort;
   sl.Sort;
   for i := 0 to sl.Count - 1 do
   for i := 0 to sl.Count - 1 do
-    Writeln(sl[i]);
+    begin
+      Writeln(outfile,sl[i]);
+      ioerror:=IOResult;
+      if ioerror<>0 then
+        begin
+          Writeln('write to file ',ParamStr(1),' failed, IOResult=',ioerror);
+          Halt(3);
+        end;
+    end;
 
 
+  close(outfile);
+  ioerror:=IOResult;
+  if ioerror<>0 then
+    begin
+      Writeln('Close(',ParamStr(1),') failed, IOResult=',ioerror);
+      Halt(4);
+    end;
   sl.Free;
   sl.Free;
 end.
 end.