From f8401ad28b0e74a11825332b939ce92b8c8ea2dc Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 25 Oct 2022 14:42:52 -0400 Subject: * Makefile.am (check-regression): Add a random suffix to results file Put the results into a subdirectory for easy unpacking. * .gitignore: Ignore it. --- Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 5912a396..53ec73c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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; \ -- cgit v1.2.1