Browse Source

* use a Pascal tool instead of a Makefile to generate the list of test files; this way the testsuite works again with older versions of make that don't support $(info ...) (e.g. 3.80 and earlier)

git-svn-id: trunk@34310 -
svenbarth 9 years ago
parent
commit
e0fd432c9d
4 changed files with 41 additions and 12 deletions
  1. 1 1
      .gitattributes
  2. 14 7
      tests/Makefile.fpc
  3. 0 4
      tests/createlst.mak
  4. 26 0
      tests/utils/createlst.pp

+ 1 - 1
.gitattributes

@@ -10143,7 +10143,6 @@ tests/bench/shortbench.pp svneol=native#text/plain
 tests/bench/stream.pp svneol=native#text/plain
 tests/bench/timer.pas svneol=native#text/plain
 tests/bench/whet.pas svneol=native#text/plain
-tests/createlst.mak svneol=native#text/plain
 tests/dbdigest.cfg.example -text
 tests/readme.txt svneol=native#text/plain
 tests/tbf/tb0001.pp svneol=native#text/plain
@@ -13444,6 +13443,7 @@ tests/utils/avx/options.pas svneol=native#text/plain
 tests/utils/avx/readme.txt svneol=native#text/plain
 tests/utils/bench.pp svneol=native#text/plain
 tests/utils/concat.pp svneol=native#text/plain
+tests/utils/createlst.pp svneol=native#text/pascal
 tests/utils/dbconfig.pp svneol=native#text/plain
 tests/utils/dbdigest.pp svneol=native#text/plain
 tests/utils/dbtests.pp svneol=native#text/plain

+ 14 - 7
tests/Makefile.fpc

@@ -10,7 +10,7 @@ fpcdir=..
 rule=allexectests
 
 [target]
-programs=gparmake
+programs=gparmake createlst
 
 [rules]
 unexport FPC_VERSION
@@ -205,6 +205,10 @@ ifndef PREPUP
 PREPUP=utils/prepup
 endif
 
+ifndef CREATELST
+CREATELST=./createlst$(EXEEXT)
+endif
+
 
 ################################
 # Units
@@ -499,6 +503,9 @@ MAKEINC=$(TEST_OUTPUTDIR)/MakeChunks-$(TEST_TARGETSUFFIX).inc
 $(GPARMAKE): $(COMPILER_UNITTARGETDIR) utils/gparmake.pp
         $(FPC) $(FPCOPT) -FE. utils/gparmake.pp $(OPT)
 
+$(CREATELST): $(COMPILER_UNITTARGETDIR) utils/createlst.pp
+        $(FPC) $(FPCOPT) -FE. utils/createlst.pp $(OPT)
+
 # Can't have testprep as prerequisite, because that is a phony target and
 # phony targets are always remade. Since the makefile will be reparsed
 # after making the MakeChunks file (because it has to be included) and all
@@ -511,21 +518,21 @@ $(GPARMAKE): $(COMPILER_UNITTARGETDIR) utils/gparmake.pp
 # As a result, we list TEST_OUTPUTDIR as a dependency (that just creates
 # the directory) and have an explicit rule to build GPARMAKE rather than
 # building it via the utils Makefile
-$(MAKEINC): $(GPARMAKE) $(TEST_OUTPUTDIR)
+$(MAKEINC): $(GPARMAKE) $(CREATELST) $(TEST_OUTPUTDIR)
 # generate rules for parallel executions of dotest
 # gparmake now also needs an additional parameter for the name of the
 # used subdirectory. Note also that the index must be increasing for each
 # new call with a gap insuring that all the previous files have lower index
 # even if CHUNKSIZE is equal to 1.
-	$(MAKE) -s --no-print-directory -f createlst.mak "TESTDIRS=$(TESTDIRS)" > testfilelist.lst
+	$(Q)$(CREATELST) $(TESTDIRS) > testfilelist.lst
 	$(Q)$(GPARMAKE) $(MAKEINC) test 1 $(CHUNKSIZE) @testfilelist.lst
-	$(MAKE) -s --no-print-directory -f createlst.mak "TESTDIRS=tbs" > tbsfilelist.lst
+	$(Q)$(CREATELST) tbs > tbsfilelist.lst
 	$(Q)$(GPARMAKE) -a $(MAKEINC) tbs 10000 $(CHUNKSIZE) @tbsfilelist.lst
-	$(MAKE) -s --no-print-directory -f createlst.mak "TESTDIRS=tbf" > tbffilelist.lst
+	$(Q)$(CREATELST) tbf > tbffilelist.lst
 	$(Q)$(GPARMAKE) -a $(MAKEINC) tbf 15000 $(CHUNKSIZE) @tbffilelist.lst
-	$(MAKE) -s --no-print-directory -f createlst.mak "TESTDIRS=webtbs" > webtbsfilelist.lst
+	$(Q)$(CREATELST) webtbs > webtbsfilelist.lst
 	$(Q)$(GPARMAKE) -a $(MAKEINC) webtbs 20000 $(CHUNKSIZE) @webtbsfilelist.lst
-	$(MAKE) -s --no-print-directory -f createlst.mak "TESTDIRS=webtbf" > webtbffilelist.lst
+	$(Q)$(CREATELST) webtbf > webtbffilelist.lst
 	$(Q)$(GPARMAKE) -a $(MAKEINC) webtbf 30000 $(CHUNKSIZE) @webtbffilelist.lst
 
 

+ 0 - 4
tests/createlst.mak

@@ -1,4 +0,0 @@
-FILES=$(sort $(wildcard $(addsuffix /t*.pp,$(TESTDIRS))))
-$(foreach filename,$(FILES),$(info $(filename)))
-
-all: ;

+ 26 - 0
tests/utils/createlst.pp

@@ -0,0 +1,26 @@
+program createlst;
+
+uses
+  SysUtils;
+
+var
+  i: LongInt;
+  sr: TSearchRec;
+  path: String;
+begin
+  if ParamCount = 0 then begin
+    Writeln('createlst PATH [PATH [...]]');
+    Exit;
+  end;
+
+  for i := 1 to ParamCount do begin
+    path := IncludeTrailingPathDelimiter(ParamStr(i));
+    if FindFirst(path + 't*.pp', 0, sr) = 0 then begin
+      repeat
+        Writeln(path + sr.Name);
+      until FindNext(sr) <> 0;
+
+      FindClose(sr);
+    end;
+  end;
+end.