summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-10-25 14:42:52 -0400
committerPaul Smith <psmith@gnu.org>2022-10-25 14:42:52 -0400
commitf8401ad28b0e74a11825332b939ce92b8c8ea2dc (patch)
tree0baf0bb5469191afd9595544a689fc15021e210d /Makefile.am
parente4b3bf7f97a9b96a6e2b8a2abc9946d42565d56b (diff)
downloadmake-git-f8401ad28b0e74a11825332b939ce92b8c8ea2dc.tar.gz
* Makefile.am (check-regression): Add a random suffix to results file
Put the results into a subdirectory for easy unpacking. * .gitignore: Ignore it.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am14
1 files changed, 11 insertions, 3 deletions
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; \