]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* Makefile.am (check-regression): Add a random suffix to results file
authorPaul Smith <psmith@gnu.org>
Tue, 25 Oct 2022 18:42:52 +0000 (14:42 -0400)
committerPaul Smith <psmith@gnu.org>
Tue, 25 Oct 2022 18:42:52 +0000 (14:42 -0400)
Put the results into a subdirectory for easy unpacking.
* .gitignore: Ignore it.

.gitignore
Makefile.am

index e93c46b9ea08650215a99b207e0fef1939619565..08195763737dcdb23c0806c5e038500610bbe1e6 100644 (file)
@@ -61,7 +61,7 @@ GccDebug/
 GccRel/
 
 # Test artifacts
-makeerror-*.tar.gz
+makeerror-*
 test-suite.log
 
 # Distribution artifacts
index 5912a396cea88697e542d9afe880b9f54a59cfff..53ec73c2eef04d0d4b973b4cc6793afccc2f6752 100644 (file)
@@ -166,13 +166,18 @@ GMK_OUTDIR = ..
 
 testlog = test-suite.log
 testresult = tests/.test-result
-errorfile = makeerror-$(host_triplet).tar.gz
+errorpre = makeerror-$(PACKAGE_VERSION)-$(host_triplet)
 
 testfiles = $(testlog) $(testresult) $(errorfile)
 MOSTLYCLEANFILES = $(testfiles)
 
 errordetails = config.status config.log src/config.h $(testlog) tests/work
 
+# Create a 4-letter random sequence
+rand_value = c = "abcdefghijklmnopqrstuvwxyz0123456789"
+rand_char  = substr(c,int(rand()*36),1)
+rand_string = $(AWK) 'BEGIN{srand(); $(rand_value); print $(rand_char) "" $(rand_char) "" $(rand_char) "" $(rand_char);}'
+
 check-regression: tests/config-flags.pm
        @rm -f $(testfiles)
        @if test -f '$(top_srcdir)/tests/run_make_tests'; then \
@@ -189,8 +194,11 @@ check-regression: tests/config-flags.pm
            echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make $(GMK_OUTDIR)/make$(EXEEXT) $(MAKETESTFLAGS)"; \
            (cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); echo $$? >.test-result) 2>&1 | tee $(testlog); \
            er=$$(cat $(testresult)); if test "$$er" -ne 0; then \
-             $(AMTAR) chf - $(errordetails) | eval GZIP= gzip $(GZIP_ENV) -c >$(errorfile); \
-             echo '*** Testing failed!  Details saved in: $(errorfile)'; \
+             dirnm="$(errorpre)-$$($(rand_string))"; fnm="$$dirnm.tar.gz"; \
+             rm -rf "$$dirnm"; mkdir "$$dirnm"; \
+             $(AMTAR) chf - $(errordetails) | (cd "$$dirnm"; $(AMTAR) xf -); \
+             $(AMTAR) chf - "$$dirnm" | eval GZIP= gzip $(GZIP_ENV) -c >"$$fnm"; \
+             echo "*** Testing FAILED!  Details: $$fnm"; \
              echo '*** Please report to <$(PACKAGE_BUGREPORT)>'; echo; \
              exit $$er; \
            fi; \